Sponsored Content
Operating Systems Linux Red Hat Creating an auto-deployment script for centos Post 302976223 by stomp on Sunday 26th of June 2016 07:56:47 AM
Old 06-26-2016
Hi,

I'm a sysadmin who does a lot of automating too.

Your script maybe good for a start. I have some points for you:

  • Yous script could use some improvements to make it simpler. But hey! It works? It may stay as it is.
  • Maybe you want a result mailed to you when the installation is read, so you know when something had failed and you'll be informed to fix it. Of course your system needs a configured mailer to do this.
  • Another buzzword of automation "idempotency": Run it as often as you want, you get always the correct result. What's regarding your script, this point should be fulfilled. Nothing bad should happen if you call it more than once, except some download trash is accumulating. So cleaning up after your script runs is a good idea.
  • You may go with your own scripts, but things tend to get more complex. So you may choose one of the configuration management or automated install systems. I'm using FAI(Nice,Primarily for Debian/Ubuntu, but also possible for CentOS(I use it to install CentOS 6+7) for automated install and chef(quite complex, steep learning curve) for configuration management. If you stay with centos, kickstart may be more convenient for you for the topic of automatic installation. And what I've read ansible is a more easy approach than chef, if you want to manage your nodes after installation.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell Script to Auto Run PHP Script

Hello All! I am looking to build a monitoring script. The script should always run as a system service of some type and should always check that a PHP script is running. Maybe there is a way to assign a PHP script to a certain PID so that the monitor script that check for the PID in top... (4 Replies)
Discussion started by: elDeuce
4 Replies

2. Shell Programming and Scripting

Wrapper script for image deployment - stdin/stdout - named pipes and the like

Hi everyone, first post here. Anyone who isn't interested in the background, press pagedown :). I sometimes need to make scripts for little things I need in the infrastructure at the company I work at. Currently I am trying to make a wrapper script for a proprietary image-deployment program.... (2 Replies)
Discussion started by: andreas.ericson
2 Replies

3. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

4. Shell Programming and Scripting

Using cp: preserving file/folder attributes and auto creating folders

Hi, Is there a way to use cp in such a way that when a file is copied to a destination, the required destination folders are automatically created with the proper permissions, and the resulting copied file has the same attributes as the original. For example if I copied... (1 Reply)
Discussion started by: pcwiz
1 Replies

5. Shell Programming and Scripting

Application Deployment Script

Dear All, I have been deploying my web application binary on Jboss application server manually on 13 servers with 2 instances on each server. i.e. 26 instances. It is really becoming time consuming to deploy the application manually. I am looking for a script which would deploy my binary file... (1 Reply)
Discussion started by: Siddheshk
1 Replies

6. Shell Programming and Scripting

Application Deployment Script

Hi, I need to develop a script which will deploy my web application binary(.war) file in the jboss application server. I also need to take the back up of the existing binary file and rename the same with current date and then deploy the new binary from my specified location. The same... (1 Reply)
Discussion started by: Siddheshk
1 Replies

7. Red Hat

How to Upgrade Centos 5.7 using Centos 5.8 ISO image on Vmware workstation

Dear Linux Experts, On my windows 7 desktop with the help of Vmware workstation (Version 7.1), created virtual machine and installed Centos 5.7 successfully using ISO image. Query : Is this possible to upgrade the Centos 5.7 using Centos 5.8 ISO image to Centos version 5.8?.. if yes kindly... (2 Replies)
Discussion started by: Ananthcn
2 Replies

8. Shell Programming and Scripting

auto kill script

Hi, I have created a shell script which is used by many users to change their password/unlock, etc., via menu. There is possibility users just close the putty window without proper exit from menu. I want a solution so that if anybody forgets to stop that session, it should kill automatically... (9 Replies)
Discussion started by: prashant2507198
9 Replies

9. Shell Programming and Scripting

How to provide auto inputs for a sub-script within a script?

Hi All, I am writing a shell script. #!/bin/bash cat /etc/hosts mkdir -p /var/tmp mount 113.123.35.37:/vol/vol615/syb /var/tmp In above script I am trying to add below predefined script/command (/var/tmp/db_tools) This command in turn ask for user input, which will be always option... (17 Replies)
Discussion started by: madhur.baharani
17 Replies
KNIFE-BOOTSTRAP(1)						    Chef Manual 						KNIFE-BOOTSTRAP(1)

NAME
knife-bootstrap - Install Chef Client on a remote host SYNOPSIS
knife bootstrap (options) -i, --identity-file IDENTITY_FILE The SSH identity file used for authentication -N, --node-name NAME The Chef node name for your new node -P, --ssh-password PASSWORD The ssh password -x, --ssh-user USERNAME The ssh username -p, --ssh-port PORT The ssh port --bootstrap-version VERSION The version of Chef to install --bootstrap-proxy PROXY_URL The proxy server for the node being bootstrapped --prerelease Install pre-release Chef gems -r, --run-list RUN_LIST Comma separated list of roles/recipes to apply --template-file TEMPLATE Full path to location of template to use --sudo Execute the bootstrap via sudo -d, --distro DISTRO Bootstrap a distro using a template --[no-]host-key-verify Enable host key verification, which is the default behavior. DESCRIPTION
Performs a Chef Bootstrap on the target node. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists. This sub-command is used internally by some cloud com- puting plugins. The bootstrap sub-command supports supplying a template to perform the bootstrap steps. If the distro is not specified (via -d or --distro option), an Ubuntu 10.04 host bootstrapped with RubyGems is assumed. The DISTRO value corresponds to the base filename of the template, in other words DISTRO.erb. A template file can be specified with the --template-file option in which case the DISTRO is not used. The sub-com- mand looks in the following locations for the template to use: o bootstrap directory in the installed Chef Knife library. o bootstrap directory in the $PWD/.chef. o bootstrap directory in the users $HOME/.chef. The default bootstrap templates are scripts that get copied to the target node (FQDN). The following distros are supported: o centos5-gems o fedora13-gems o ubuntu10.04-gems o ubuntu10.04-apt The gems installations will use RubyGems 1.3.6 and Chef installed as a gem. The apt installation will use the Opscode APT repository. In addition to handling the software installation, these bootstrap templates do the following: o Write the validation.pem per the local knife configuration. o Write a default config file for Chef (/etc/chef/client.rb) using values from the knife.rb. o Create a JSON attributes file containing the specified run list and run Chef. In the case of the RubyGems, the client.rb will be written from scratch with a minimal set of values; see EXAMPLES. In the case of APT Package installation, client.rb will have the validation_client_name appended if it is not set to chef-validator (default config value), and the node_name will be added if chef_node_name option is specified. When this is complete, the bootstrapped node will have: o Latest Chef version installed from RubyGems or APT Packages from Opscode. This may be a later version than the local system. o Be validated with the configured Chef Server. o Have run Chef with its default run list if one is specfied. Additional custom bootstrap templates can be created and stored in .chef/bootstrap/DISTRO.erb, replacing DISTRO with the value passed with the -d or --distro option. See EXAMPLES for more information. EXAMPLES
Setting up a custom bootstrap is fairly straightforward. Create a .chef/bootstrap directory in your Chef Repository or in $HOME/.chef/boot- strap. Then create the ERB template file. mkdir ~/.chef/bootstrap vi ~/.chef/bootstrap/debian5.0-apt.erb For example, to create a new bootstrap template that should be used when setting up a new Debian node. Edit the template to run the com- mands, set up the validation certificate and the client configuration file, and finally to run chef-client on completion. The bootstrap template can be called with: knife bootstrap mynode.example.com --template-file ~/.chef/bootstrap/debian5.0-apt.erb Or, knife bootstrap mynode.example.com --distro debian5.0-apt The --distro parameter will automatically look in the ~/.chef/bootstrap directory for a file named debian5.0-apt.erb. Templates provided by the Chef installation are located in BASEDIR/lib/chef/knife/bootstrap/*.erb, where BASEDIR is the location where the package or Gem installed the Chef client libraries. BUGS
knife bootstrap is not capable of bootstrapping multiple hosts in parallel. The bootstrap script is passed as an argument to sh(1) on the remote system, so sensitive information contained in the script will be visi- ble to other users via the process list using tools such as ps(1). SEE ALSO
knife-ssh(1) AUTHOR
Chef was written by Adam Jacob adam@opscode.com with many contributions from the community. DOCUMENTATION
This manual page was written by Joshua Timberman joshua@opscode.com. Permission is granted to copy, distribute and / or modify this docu- ment under the terms of the Apache 2.0 License. CHEF
Knife is distributed with Chef. http://wiki.opscode.com/display/chef/Home Chef 10.12.0 June 2012 KNIFE-BOOTSTRAP(1)
All times are GMT -4. The time now is 05:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy