diff options
Diffstat (limited to 'meta-openstack/recipes-support/puppet/README')
| -rw-r--r-- | meta-openstack/recipes-support/puppet/README | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/meta-openstack/recipes-support/puppet/README b/meta-openstack/recipes-support/puppet/README new file mode 100644 index 0000000..2de808a --- /dev/null +++ b/meta-openstack/recipes-support/puppet/README | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | What is Puppet | ||
| 2 | ------------------------ | ||
| 3 | Puppet is a configuration management system that allows you to define the | ||
| 4 | state of your IT infrastructure, then automatically enforces the correct state. | ||
| 5 | |||
| 6 | |||
| 7 | Basic Requirements | ||
| 8 | ------------------------ | ||
| 9 | Ruby 1.8.7 or later | ||
| 10 | Facter 1.7.0 or later | ||
| 11 | Hiera 1.0 or later | ||
| 12 | The json gem (any modern version) | ||
| 13 | |||
| 14 | |||
| 15 | Simple Demo | ||
| 16 | ------------------------ | ||
| 17 | In this simple demo, we have a CA master server named 'master' and ip is 192.168.2.83 | ||
| 18 | and an agent node named 'agent', ip is 192.168.2.30. | ||
| 19 | |||
| 20 | On master server, file 'test.cfg' is under /etc/puppet/files/, puppet will sync this | ||
| 21 | file to /opt/ folder on agent node. | ||
| 22 | |||
| 23 | Step 1: Configure Puppet CA Master Server | ||
| 24 | 1) create a puppet group and user | ||
| 25 | $ puppet resource group puppet ensure=presnt | ||
| 26 | $ puppet resource user puppet ensure=present gid=puppet shell='/sbin/nologin' | ||
| 27 | |||
| 28 | 2) create the CA certificate and the puppet master certificate | ||
| 29 | $ puppet master --verbose --no-daemonize | ||
| 30 | (Once it says Notice: Starting Puppet master version <VERSION>, type ctrl-C to kill the process) | ||
| 31 | |||
| 32 | 3) $ vi /etc/hosts | ||
| 33 | add new line: | ||
| 34 | 192.168.2.30 agent | ||
| 35 | |||
| 36 | 4) start puppet master | ||
| 37 | $ puppet master --verbose --no-daemonize & | ||
| 38 | |||
| 39 | |||
| 40 | Step 2: Config Puppet Agent Node | ||
| 41 | 1) Edit puppet.conf | ||
| 42 | $ echo "[main] | ||
| 43 | server = master" >> /etc/puppet/puppet.conf | ||
| 44 | |||
| 45 | 2) $ vi /etc/hosts | ||
| 46 | add new line: | ||
| 47 | 192.168.2.83 master | ||
| 48 | |||
| 49 | 3) Request certificates | ||
| 50 | $ puppet agent --test --ca_server=t2080qds -w 60 | ||
| 51 | (Accept the request on master server by this command: puppet cert sign --all) | ||
| 52 | |||
| 53 | |||
| 54 | Step 3: Add site map on master | ||
| 55 | 1) Edit /etc/puppet/fileserver.conf to make /etc/puppet/files available | ||
| 56 | $ mkdir /etc/puppet/files | ||
| 57 | $ touch /etc/puppet/files/test.cfg | ||
| 58 | $ vi /etc/puppet/fileserver.conf | ||
| 59 | add following lines: | ||
| 60 | [extra_files] | ||
| 61 | path /etc/puppet/files | ||
| 62 | allow * | ||
| 63 | |||
| 64 | 2) Add a new sitemap | ||
| 65 | $ vi /etc/puppet/manifests/site.pp | ||
| 66 | add follwing lines: | ||
| 67 | file | ||
| 68 | { "/opt/test.cfg": | ||
| 69 | source => "puppet:///extra_files/test.cfg", | ||
| 70 | } | ||
| 71 | |||
| 72 | |||
| 73 | Step 4: Run puppet on agent | ||
| 74 | $ puppet agent --test | ||
| 75 | $ ls /opt/ | ||
