Skip to content

Aresall1990/puppet-installation-script

 
 

Repository files navigation

#Try puppetinstall

It is on Puppet v3 and support Debian and CentOS operating systems.

[Deprecated] puppet-installation-script

Puppet installation script is a simple automation tool to install puppet master and puppet client with minimal effort. User only need to know the required environment details to setup the puppet environment. All other configurations will be generated by this script.

Things to know before running the script

  • User need to have ‘root’ or ‘sudo’ access to the system.

  • There are two ways to execute the script;

    1. Run the script in interactive mode.

      Script will ask several questions that user need to answer. According to the answers script will install and configure the puppet master or the puppet client.

    2. Pass information as command line arguments to the script.

      User can specify all relevant parameters with relevant values and run the script. Those parameters will describe in following steps.

  • User should know following details

    1. Install puppet master or puppet agent that the user need to install and configure. (--master or --agent)

    2. Domain name that will associate with the environment. (--domain your.domain.com)

      eg: apps.wso2.com

    3. IP address of the instance the puppet master will be installed in. (--master-ip 10.0.0.1)

      eg: 10.10.10.10

    4. Host name convention of other instances. By default puppet master will have ‘puppetmaster’ as the host name. (--hostname node001)

      eg. node001, node002 …

      ** Note : Do not give any fully qualified domain names (FQDN) as hostname like node0023.apps.wso2.com.

    • Operating system on the instance. (--os ubuntu)

      ** Note : Currently this supports only for Ubuntu and Debian systems only.

Get the puppet installation script

  • Get a clone of the setup scripts from github.

     git clone https://github.com/thilinapiy/puppet-installation-script 

Installing puppet master

  1. Copy the ‘puppet-installation-script’ to the desired instance.

  2. Get the IP address of the instance. Make sure it is a static IP.

  3. Change the current directory in to ‘puppet-installation-script’.

  4. Run the script;

    In interactive mode:

     sudo python puppet_install.py  

    And set option as ‘1’.

    Or pass values as arguments;

     sudo python puppet_install.py --master \
                                     --domain apps.wso2.com \  
                                     --master-ip 10.1.1.1 \  
                                     --os ubuntu 

Installing puppet agent

  1. First install the puppet master. If that is almost done get the IP address of it.

  2. Fix a instance hostname naming convention like node001, node002, … .

  3. Copy the ‘puppet-installation-script’ to the desired instance.

  4. Change the current directory in to ‘puppet-installation-script’.

  5. Run the script;

    In interactive mode:

     sudo python puppet_install.py  

    And set option as ‘2’.

    Or pass values as arguments:

     sudo python puppet_install.py --agent \
                                     --domain apps.wso2.com \
                                     --master-ip 10.1.1.1 \
                                     --hostname node001 \
                                     --os ubuntu  

To verify (Optional)

  1. Make ‘manifests’ directory in ‘/mnt/puppet/your.domain.com/’ location.

     mkdir   /mnt/puppet/apps.wso2.com/manifests 
  2. Create a ‘site.pp’ file in that location.

     touch   /mnt/puppet/apps.wso2.com/manifests/site.pp  
  3. Add following script on that site.pp with respective hostname that you gave to the relevant node that you are going to test.

     node 'node001.apps.wso2.com' {
    
             file { '/mytestfile.t':
                     owner   => 'root',
                     group   => 'root',
                     content => "This will be on the file.\n",
                     ensure  => present,
             }
     } 
  4. On the puppet agent node (node001) run

     puppetd -vt  
  5. Check the file in ‘/mytestfile.t’.

     cat /mytestfile.t  

About

This script will install puppet master and puppet agents in an interactive way.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%