summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangHaibo <b40869@freescale.com>2014-12-03 17:07:56 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-12-18 12:59:52 -0500
commit733213218602067a6077b810d44edc025b1fa741 (patch)
tree3fe39096eae7e5ae555ec9f1cd0969b8cc25083f
parent12374d96e4b6130bdd26cb9b688c2ddc95f77d0d (diff)
downloadmeta-cloud-services-733213218602067a6077b810d44edc025b1fa741.tar.gz
puppet: add recipe for puppet 3.7.3
A simple demo is added Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack/recipes-support/puppet/README75
-rw-r--r--meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch23
-rw-r--r--meta-openstack/recipes-support/puppet/puppet_3.7.3.bb31
3 files changed, 129 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 @@
1What is Puppet
2------------------------
3Puppet is a configuration management system that allows you to define the
4state of your IT infrastructure, then automatically enforces the correct state.
5
6
7Basic Requirements
8------------------------
9Ruby 1.8.7 or later
10Facter 1.7.0 or later
11Hiera 1.0 or later
12The json gem (any modern version)
13
14
15Simple Demo
16------------------------
17In this simple demo, we have a CA master server named 'master' and ip is 192.168.2.83
18and an agent node named 'agent', ip is 192.168.2.30.
19
20On master server, file 'test.cfg' is under /etc/puppet/files/, puppet will sync this
21file to /opt/ folder on agent node.
22
23Step 1: Configure Puppet CA Master Server
241) 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
282) 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
323) $ vi /etc/hosts
33add new line:
34192.168.2.30 agent
35
364) start puppet master
37$ puppet master --verbose --no-daemonize &
38
39
40Step 2: Config Puppet Agent Node
411) Edit puppet.conf
42$ echo "[main]
43server = master" >> /etc/puppet/puppet.conf
44
452) $ vi /etc/hosts
46add new line:
47192.168.2.83 master
48
493) 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
54Step 3: Add site map on master
551) 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
59add following lines:
60[extra_files]
61 path /etc/puppet/files
62 allow *
63
642) Add a new sitemap
65$ vi /etc/puppet/manifests/site.pp
66add follwing lines:
67file
68{ "/opt/test.cfg":
69source => "puppet:///extra_files/test.cfg",
70}
71
72
73Step 4: Run puppet on agent
74$ puppet agent --test
75$ ls /opt/
diff --git a/meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch b/meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
new file mode 100644
index 0000000..a5c8e3b
--- /dev/null
+++ b/meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
@@ -0,0 +1,23 @@
1diff -urN puppet-3.7.3_ori/puppet.gemspec puppet-3.7.3/puppet.gemspec
2--- puppet-3.7.3_ori/puppet.gemspec 1970-01-01 08:00:00.000000000 +0800
3+++ puppet-3.7.3/puppet.gemspec 2014-11-12 14:30:07.000000000 +0800
4@@ -0,0 +1,19 @@
5+$:.unshift(File.dirname(__FILE__) + '/lib')
6+require 'puppet/version'
7+
8+Gem::Specification.new do |s|
9+ s.name = 'puppet'
10+ s.version = Puppet::PUPPETVERSION
11+ s.platform = Gem::Platform::RUBY
12+ s.summary = 'Open source Puppet is a configuration management system'
13+ s.description = s.summary
14+ s.author = 'Yang Haibo'
15+ s.email = 'b40869@freescale.com'
16+ s.homepage = 'https://puppetlabs.com/puppet/puppet-open-source'
17+ s.license = 'Apache 2.0'
18+
19+ s.bindir = 'bin'
20+ s.executables = ['puppet', 'extlookup2hiera']
21+ s.require_path = 'lib'
22+ s.files = %w(LICENSE README.md Rakefile) + Dir.glob('{lib,spec}/**/*')
23+end
diff --git a/meta-openstack/recipes-support/puppet/puppet_3.7.3.bb b/meta-openstack/recipes-support/puppet/puppet_3.7.3.bb
new file mode 100644
index 0000000..afd9a23
--- /dev/null
+++ b/meta-openstack/recipes-support/puppet/puppet_3.7.3.bb
@@ -0,0 +1,31 @@
1SUMMARY = "Open source Puppet is a configuration management system"
2HOMEPAGE = "https://puppetlabs.com/puppet/puppet-open-source"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=f257790c70561550fd666c6e0044fd89"
5
6SRC_URI = " \
7 https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
8 file://add_puppet_gemspec.patch \
9"
10SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
11SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
12
13inherit ruby
14
15DEPENDS += " \
16 ruby \
17 facter \
18 hiera \
19"
20
21RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
22
23do_install_append() {
24 install -d ${D}${sysconfdir}/puppet
25 install -d ${D}${sysconfdir}/puppet/manifests
26 install -d ${D}${sysconfdir}/puppet/modules
27
28 install -m 655 ${S}/conf/auth.conf ${D}${sysconfdir}/puppet/
29 install -m 655 ${S}/conf/fileserver.conf ${D}${sysconfdir}/puppet/
30 install -m 655 ${S}/conf/tagmail.conf ${D}${sysconfdir}/puppet/
31}