AWS Amazon 上 搭建 安装 puppet

FIRST PART,   NETWORK INTERFACE

  1. 增加同网段的 network interface

2.修改security groups 的权限    Inbound   ,,,   Outbound

3.   attach   to  instance

4.    修改 interface配置

root@ip-172-31-28-229:/home/ubuntu# cd /etc/network/interfaces.d/
root@ip-172-31-28-229:/etc/network/interfaces.d# ls
eth0.cfg  eth1.cfg

 

SECOND PART,   CONFIG  PUPPET

I just follow this tutorial

https://www.digitalocean.com/community/tutorials/how-to-install-puppet-to-manage-your-server-infrastructure

其中,我省略了ntp部分   ssl部分   lock版本部分 ,为了快速配置

Master   command :

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 18  wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
 19  ls
 20  dpkg -i puppetlabs-release-precise.deb
 21  apt-get update
 22  apt-get install -y puppet augeas-tools
 23  sed -i 's/templatedir/#templatedir/g' /etc/puppet/puppet.conf
 24  puppet --version
 25  ls
 26  wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
 27  sudo apt-get install puppetmaster-passenger
 28  service apache2 stop
 29  cd /etc/puppet/
 30  ls
 31  cat puppet.conf
 32  cd manifests/
 33  ls
 34  touch /etc/puppet/manifests/site.pp
 35  puppet help | tail -n 1
 36  cd /var/lib/puppet/
 37  ls
 38  cd ssl/
 39  ls
 40  cd
 41  hostname -f
 42  puppet cert list --all
 43  puppet cert sign --all
 45  service puppet start
 46  service apache2 start
 47  puppet cert sign --all
 48  puppet cert list --all
 49  ping ip-172-31-19-247
 50  puppet cert sign --all
 51  puppet cert list --all
 52  screen tail -f /var/log/syslog
 53  nano  /etc/puppet/manifests/site.pp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Client  command :

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

10  wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
 11  ls
 12  dpkg -i puppetlabs-release-precise.deb
 13  apt-get update
 14  apt-get install -y puppet augeas-tools
 15  sed -i 's/templatedir/#templatedir/g' /etc/puppet/puppet.conf
 16  puppet --version
 17  puppet describe

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

修改 puppet 配置文件  puppet.conf  以及 /etc/default/puppet

root@ip-172-31-19-247:/home/ubuntu# cat /etc/puppet/puppet.conf

 [main]
 logdir=/var/log/puppet
 vardir=/var/lib/puppet
 ssldir=/var/lib/puppet/ssl
 rundir=/var/run/puppet
 factpath=$vardir/lib/facter
[agent]
 server = ip-172-31-28-229.us-west-2.compute.internal

 

ubuntu@ip-172-31-19-247:~$ cat /etc/default/puppet

# Defaults for puppet - sourced by /etc/init.d/puppet
# Enable puppet agent service?
# Setting this to "yes" allows the puppet agent service to run.
# Setting this to "no" keeps the puppet agent service from running.
START=yes

How The Main Manifest Is Executed

The puppet agent periodically checks in with the puppet master (typically every 30 minutes). During this time, it will send facts about itself to the master, and pull a current catalog�a compiled list of resources and their desired states that are relevant to the agent, determined by the main manifest. The agent node will then attempt to make the appropriate changes to achieve its desired state. This cycle will continue as long as the Puppet master is running and communicating with the agent nodes.

IMMEDIATE EXECUTION ON A PARTICULAR AGENT NODE

It is also possible initiate the check for a particular agent node manually, by running the following command (on the agent node in question):

puppet agent --test

puppet agent --test --onetime --no-daemonize  --verbosepuppet agent --test --onetime --no-daemonize  --verbose --noop         noop 意思不真正执行
备注 :

1.Puppet  的版本问题

旧版puppet2.7    的Master node 安装不一样

新版puppet3.8    Install the puppetmaster-passenger package:

sudo apt-get install puppetmaster-passenger

The Puppet master, Passenger, Apache, and other required packages are now installed. Because we are using Passenger with Apache, the Puppet master process is controlled by Apache, i.e. it runs when Apache is running.

Before continuing, stop the Puppet master by stopping the apache2service:

sudo service apache2 stop

而且系统没有puppetmaster 这个 服务

root@ip-172-31-28-229:/etc/network/interfaces.d# service puppetmaster status
puppetmaster: unrecognized service

我记得puppet2.7  是有的

再然后,client node 执行命令也可以 不一样

puppet2.7   中 客户端 这么发送请求     puppetd �test �server


你可能感兴趣的:(ubuntu,AWS,puppet,Amazon)