All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] puppet: add recipe for puppet 3.7.3
@ 2014-12-03  9:07 YangHaibo
  2014-12-03 15:21 ` Bruce Ashfield
  0 siblings, 1 reply; 3+ messages in thread
From: YangHaibo @ 2014-12-03  9:07 UTC (permalink / raw)
  To: meta-virtualization

A simple demo is added
---
 meta-openstack/recipes-support/puppet/README       | 75 ++++++++++++++++++++++
 .../puppet/puppet/add_puppet_gemspec.patch         | 23 +++++++
 .../recipes-support/puppet/puppet_3.7.3.bb         | 31 +++++++++
 3 files changed, 129 insertions(+)
 create mode 100644 meta-openstack/recipes-support/puppet/README
 create mode 100644 meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
 create mode 100644 meta-openstack/recipes-support/puppet/puppet_3.7.3.bb

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 @@
+What is Puppet
+------------------------
+Puppet is a configuration management system that allows you to define the
+state of your IT infrastructure, then automatically enforces the correct state.
+
+
+Basic Requirements
+------------------------
+Ruby 1.8.7 or later
+Facter 1.7.0 or later
+Hiera 1.0 or later
+The json gem (any modern version)
+
+
+Simple Demo
+------------------------
+In this simple demo, we have a CA master server named 'master' and ip is 192.168.2.83
+and an agent node named 'agent', ip is 192.168.2.30. 
+
+On master server, file 'test.cfg' is under /etc/puppet/files/, puppet will sync this
+file to /opt/ folder on agent node.
+
+Step 1: Configure Puppet CA Master Server
+1) create a puppet group and user
+$ puppet resource group puppet ensure=presnt
+$ puppet resource user puppet ensure=present gid=puppet shell='/sbin/nologin'
+
+2) create the CA certificate and the puppet master certificate
+$ puppet master --verbose --no-daemonize
+(Once it says Notice: Starting Puppet master version <VERSION>, type ctrl-C to kill the process)
+
+3) $ vi /etc/hosts
+add new line:
+192.168.2.30    agent
+
+4) start puppet master
+$ puppet master --verbose --no-daemonize &
+
+
+Step 2: Config Puppet Agent Node
+1) Edit puppet.conf
+$ echo "[main]
+server = master" >> /etc/puppet/puppet.conf
+
+2) $ vi /etc/hosts
+add new line:
+192.168.2.83    master
+
+3) Request certificates
+$ puppet agent --test --ca_server=t2080qds -w 60
+(Accept the request on master server by this command: puppet cert sign --all)
+
+
+Step 3: Add site map on master
+1) Edit /etc/puppet/fileserver.conf to make /etc/puppet/files available
+$ mkdir /etc/puppet/files
+$ touch /etc/puppet/files/test.cfg
+$ vi /etc/puppet/fileserver.conf
+add following lines:
+[extra_files]
+   path /etc/puppet/files
+   allow *
+
+2) Add a new sitemap
+$ vi /etc/puppet/manifests/site.pp
+add follwing lines:
+file
+{ "/opt/test.cfg":
+source => "puppet:///extra_files/test.cfg",
+}
+
+
+Step 4: Run puppet on agent
+$ puppet agent --test
+$ 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 @@
+diff -urN puppet-3.7.3_ori/puppet.gemspec puppet-3.7.3/puppet.gemspec
+--- puppet-3.7.3_ori/puppet.gemspec	1970-01-01 08:00:00.000000000 +0800
++++ puppet-3.7.3/puppet.gemspec	2014-11-12 14:30:07.000000000 +0800
+@@ -0,0 +1,19 @@
++$:.unshift(File.dirname(__FILE__) + '/lib')
++require 'puppet/version'
++
++Gem::Specification.new do |s|
++  s.name = 'puppet'
++  s.version = Puppet::PUPPETVERSION
++  s.platform = Gem::Platform::RUBY
++  s.summary = 'Open source Puppet is a configuration management system'
++  s.description = s.summary
++  s.author = 'Yang Haibo'
++  s.email = 'b40869@freescale.com'
++  s.homepage = 'https://puppetlabs.com/puppet/puppet-open-source'
++  s.license = 'Apache 2.0'
++
++  s.bindir       = 'bin'
++  s.executables  = ['puppet', 'extlookup2hiera']
++  s.require_path = 'lib'
++  s.files = %w(LICENSE README.md Rakefile) + Dir.glob('{lib,spec}/**/*')
++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 @@
+SUMMARY = "Open source Puppet is a configuration management system"
+HOMEPAGE = "https://puppetlabs.com/puppet/puppet-open-source"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f257790c70561550fd666c6e0044fd89"
+
+SRC_URI = " \
+    https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
+    file://add_puppet_gemspec.patch \
+"
+SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
+SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
+
+inherit ruby
+
+DEPENDS += " \
+        ruby \
+        facter \
+        hiera \
+"
+
+RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/puppet
+    install -d ${D}${sysconfdir}/puppet/manifests
+    install -d ${D}${sysconfdir}/puppet/modules
+
+    install -m 655 ${S}/conf/auth.conf ${D}${sysconfdir}/puppet/
+    install -m 655 ${S}/conf/fileserver.conf ${D}${sysconfdir}/puppet/
+    install -m 655 ${S}/conf/tagmail.conf ${D}${sysconfdir}/puppet/
+}
-- 
1.9.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] puppet: add recipe for puppet 3.7.3
  2014-12-03  9:07 [PATCH v2] puppet: add recipe for puppet 3.7.3 YangHaibo
@ 2014-12-03 15:21 ` Bruce Ashfield
  2014-12-18 18:01   ` Bruce Ashfield
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Ashfield @ 2014-12-03 15:21 UTC (permalink / raw)
  To: YangHaibo; +Cc: meta-virtualization

On Wed, Dec 3, 2014 at 4:07 AM, YangHaibo <b40869@freescale.com> wrote:
> A simple demo is added

Fantastic.

I'll queue the patches and do a test build. With the chef support and
now puppet, we have
some nice functionality for configuration and deployment.

Cheers,

Bruce

> ---
>  meta-openstack/recipes-support/puppet/README       | 75 ++++++++++++++++++++++
>  .../puppet/puppet/add_puppet_gemspec.patch         | 23 +++++++
>  .../recipes-support/puppet/puppet_3.7.3.bb         | 31 +++++++++
>  3 files changed, 129 insertions(+)
>  create mode 100644 meta-openstack/recipes-support/puppet/README
>  create mode 100644 meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
>  create mode 100644 meta-openstack/recipes-support/puppet/puppet_3.7.3.bb
>
> 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 @@
> +What is Puppet
> +------------------------
> +Puppet is a configuration management system that allows you to define the
> +state of your IT infrastructure, then automatically enforces the correct state.
> +
> +
> +Basic Requirements
> +------------------------
> +Ruby 1.8.7 or later
> +Facter 1.7.0 or later
> +Hiera 1.0 or later
> +The json gem (any modern version)
> +
> +
> +Simple Demo
> +------------------------
> +In this simple demo, we have a CA master server named 'master' and ip is 192.168.2.83
> +and an agent node named 'agent', ip is 192.168.2.30.
> +
> +On master server, file 'test.cfg' is under /etc/puppet/files/, puppet will sync this
> +file to /opt/ folder on agent node.
> +
> +Step 1: Configure Puppet CA Master Server
> +1) create a puppet group and user
> +$ puppet resource group puppet ensure=presnt
> +$ puppet resource user puppet ensure=present gid=puppet shell='/sbin/nologin'
> +
> +2) create the CA certificate and the puppet master certificate
> +$ puppet master --verbose --no-daemonize
> +(Once it says Notice: Starting Puppet master version <VERSION>, type ctrl-C to kill the process)
> +
> +3) $ vi /etc/hosts
> +add new line:
> +192.168.2.30    agent
> +
> +4) start puppet master
> +$ puppet master --verbose --no-daemonize &
> +
> +
> +Step 2: Config Puppet Agent Node
> +1) Edit puppet.conf
> +$ echo "[main]
> +server = master" >> /etc/puppet/puppet.conf
> +
> +2) $ vi /etc/hosts
> +add new line:
> +192.168.2.83    master
> +
> +3) Request certificates
> +$ puppet agent --test --ca_server=t2080qds -w 60
> +(Accept the request on master server by this command: puppet cert sign --all)
> +
> +
> +Step 3: Add site map on master
> +1) Edit /etc/puppet/fileserver.conf to make /etc/puppet/files available
> +$ mkdir /etc/puppet/files
> +$ touch /etc/puppet/files/test.cfg
> +$ vi /etc/puppet/fileserver.conf
> +add following lines:
> +[extra_files]
> +   path /etc/puppet/files
> +   allow *
> +
> +2) Add a new sitemap
> +$ vi /etc/puppet/manifests/site.pp
> +add follwing lines:
> +file
> +{ "/opt/test.cfg":
> +source => "puppet:///extra_files/test.cfg",
> +}
> +
> +
> +Step 4: Run puppet on agent
> +$ puppet agent --test
> +$ 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 @@
> +diff -urN puppet-3.7.3_ori/puppet.gemspec puppet-3.7.3/puppet.gemspec
> +--- puppet-3.7.3_ori/puppet.gemspec    1970-01-01 08:00:00.000000000 +0800
> ++++ puppet-3.7.3/puppet.gemspec        2014-11-12 14:30:07.000000000 +0800
> +@@ -0,0 +1,19 @@
> ++$:.unshift(File.dirname(__FILE__) + '/lib')
> ++require 'puppet/version'
> ++
> ++Gem::Specification.new do |s|
> ++  s.name = 'puppet'
> ++  s.version = Puppet::PUPPETVERSION
> ++  s.platform = Gem::Platform::RUBY
> ++  s.summary = 'Open source Puppet is a configuration management system'
> ++  s.description = s.summary
> ++  s.author = 'Yang Haibo'
> ++  s.email = 'b40869@freescale.com'
> ++  s.homepage = 'https://puppetlabs.com/puppet/puppet-open-source'
> ++  s.license = 'Apache 2.0'
> ++
> ++  s.bindir       = 'bin'
> ++  s.executables  = ['puppet', 'extlookup2hiera']
> ++  s.require_path = 'lib'
> ++  s.files = %w(LICENSE README.md Rakefile) + Dir.glob('{lib,spec}/**/*')
> ++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 @@
> +SUMMARY = "Open source Puppet is a configuration management system"
> +HOMEPAGE = "https://puppetlabs.com/puppet/puppet-open-source"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=f257790c70561550fd666c6e0044fd89"
> +
> +SRC_URI = " \
> +    https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
> +    file://add_puppet_gemspec.patch \
> +"
> +SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
> +SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
> +
> +inherit ruby
> +
> +DEPENDS += " \
> +        ruby \
> +        facter \
> +        hiera \
> +"
> +
> +RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
> +
> +do_install_append() {
> +    install -d ${D}${sysconfdir}/puppet
> +    install -d ${D}${sysconfdir}/puppet/manifests
> +    install -d ${D}${sysconfdir}/puppet/modules
> +
> +    install -m 655 ${S}/conf/auth.conf ${D}${sysconfdir}/puppet/
> +    install -m 655 ${S}/conf/fileserver.conf ${D}${sysconfdir}/puppet/
> +    install -m 655 ${S}/conf/tagmail.conf ${D}${sysconfdir}/puppet/
> +}
> --
> 1.9.2
>
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] puppet: add recipe for puppet 3.7.3
  2014-12-03 15:21 ` Bruce Ashfield
@ 2014-12-18 18:01   ` Bruce Ashfield
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Ashfield @ 2014-12-18 18:01 UTC (permalink / raw)
  To: YangHaibo; +Cc: meta-virtualization

On Wed, Dec 3, 2014 at 10:21 AM, Bruce Ashfield
<bruce.ashfield@gmail.com> wrote:
> On Wed, Dec 3, 2014 at 4:07 AM, YangHaibo <b40869@freescale.com> wrote:
>> A simple demo is added
>
> Fantastic.
>
> I'll queue the patches and do a test build. With the chef support and
> now puppet, we have
> some nice functionality for configuration and deployment.

My apologies for the delay on this. I was travelling for a week and
didn't get the cycles
to to all the builds I wanted.

But I've now built and tested this. I've pushed it to the master and
juno branches.
If you need it elsewhere, let me know and I can cherry pick and push.

Bruce

>
> Cheers,
>
> Bruce
>
>> ---
>>  meta-openstack/recipes-support/puppet/README       | 75 ++++++++++++++++++++++
>>  .../puppet/puppet/add_puppet_gemspec.patch         | 23 +++++++
>>  .../recipes-support/puppet/puppet_3.7.3.bb         | 31 +++++++++
>>  3 files changed, 129 insertions(+)
>>  create mode 100644 meta-openstack/recipes-support/puppet/README
>>  create mode 100644 meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
>>  create mode 100644 meta-openstack/recipes-support/puppet/puppet_3.7.3.bb
>>
>> 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 @@
>> +What is Puppet
>> +------------------------
>> +Puppet is a configuration management system that allows you to define the
>> +state of your IT infrastructure, then automatically enforces the correct state.
>> +
>> +
>> +Basic Requirements
>> +------------------------
>> +Ruby 1.8.7 or later
>> +Facter 1.7.0 or later
>> +Hiera 1.0 or later
>> +The json gem (any modern version)
>> +
>> +
>> +Simple Demo
>> +------------------------
>> +In this simple demo, we have a CA master server named 'master' and ip is 192.168.2.83
>> +and an agent node named 'agent', ip is 192.168.2.30.
>> +
>> +On master server, file 'test.cfg' is under /etc/puppet/files/, puppet will sync this
>> +file to /opt/ folder on agent node.
>> +
>> +Step 1: Configure Puppet CA Master Server
>> +1) create a puppet group and user
>> +$ puppet resource group puppet ensure=presnt
>> +$ puppet resource user puppet ensure=present gid=puppet shell='/sbin/nologin'
>> +
>> +2) create the CA certificate and the puppet master certificate
>> +$ puppet master --verbose --no-daemonize
>> +(Once it says Notice: Starting Puppet master version <VERSION>, type ctrl-C to kill the process)
>> +
>> +3) $ vi /etc/hosts
>> +add new line:
>> +192.168.2.30    agent
>> +
>> +4) start puppet master
>> +$ puppet master --verbose --no-daemonize &
>> +
>> +
>> +Step 2: Config Puppet Agent Node
>> +1) Edit puppet.conf
>> +$ echo "[main]
>> +server = master" >> /etc/puppet/puppet.conf
>> +
>> +2) $ vi /etc/hosts
>> +add new line:
>> +192.168.2.83    master
>> +
>> +3) Request certificates
>> +$ puppet agent --test --ca_server=t2080qds -w 60
>> +(Accept the request on master server by this command: puppet cert sign --all)
>> +
>> +
>> +Step 3: Add site map on master
>> +1) Edit /etc/puppet/fileserver.conf to make /etc/puppet/files available
>> +$ mkdir /etc/puppet/files
>> +$ touch /etc/puppet/files/test.cfg
>> +$ vi /etc/puppet/fileserver.conf
>> +add following lines:
>> +[extra_files]
>> +   path /etc/puppet/files
>> +   allow *
>> +
>> +2) Add a new sitemap
>> +$ vi /etc/puppet/manifests/site.pp
>> +add follwing lines:
>> +file
>> +{ "/opt/test.cfg":
>> +source => "puppet:///extra_files/test.cfg",
>> +}
>> +
>> +
>> +Step 4: Run puppet on agent
>> +$ puppet agent --test
>> +$ 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 @@
>> +diff -urN puppet-3.7.3_ori/puppet.gemspec puppet-3.7.3/puppet.gemspec
>> +--- puppet-3.7.3_ori/puppet.gemspec    1970-01-01 08:00:00.000000000 +0800
>> ++++ puppet-3.7.3/puppet.gemspec        2014-11-12 14:30:07.000000000 +0800
>> +@@ -0,0 +1,19 @@
>> ++$:.unshift(File.dirname(__FILE__) + '/lib')
>> ++require 'puppet/version'
>> ++
>> ++Gem::Specification.new do |s|
>> ++  s.name = 'puppet'
>> ++  s.version = Puppet::PUPPETVERSION
>> ++  s.platform = Gem::Platform::RUBY
>> ++  s.summary = 'Open source Puppet is a configuration management system'
>> ++  s.description = s.summary
>> ++  s.author = 'Yang Haibo'
>> ++  s.email = 'b40869@freescale.com'
>> ++  s.homepage = 'https://puppetlabs.com/puppet/puppet-open-source'
>> ++  s.license = 'Apache 2.0'
>> ++
>> ++  s.bindir       = 'bin'
>> ++  s.executables  = ['puppet', 'extlookup2hiera']
>> ++  s.require_path = 'lib'
>> ++  s.files = %w(LICENSE README.md Rakefile) + Dir.glob('{lib,spec}/**/*')
>> ++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 @@
>> +SUMMARY = "Open source Puppet is a configuration management system"
>> +HOMEPAGE = "https://puppetlabs.com/puppet/puppet-open-source"
>> +LICENSE = "Apache-2.0"
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=f257790c70561550fd666c6e0044fd89"
>> +
>> +SRC_URI = " \
>> +    https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
>> +    file://add_puppet_gemspec.patch \
>> +"
>> +SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
>> +SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
>> +
>> +inherit ruby
>> +
>> +DEPENDS += " \
>> +        ruby \
>> +        facter \
>> +        hiera \
>> +"
>> +
>> +RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
>> +
>> +do_install_append() {
>> +    install -d ${D}${sysconfdir}/puppet
>> +    install -d ${D}${sysconfdir}/puppet/manifests
>> +    install -d ${D}${sysconfdir}/puppet/modules
>> +
>> +    install -m 655 ${S}/conf/auth.conf ${D}${sysconfdir}/puppet/
>> +    install -m 655 ${S}/conf/fileserver.conf ${D}${sysconfdir}/puppet/
>> +    install -m 655 ${S}/conf/tagmail.conf ${D}${sysconfdir}/puppet/
>> +}
>> --
>> 1.9.2
>>
>> --
>> _______________________________________________
>> meta-virtualization mailing list
>> meta-virtualization@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-virtualization
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end"



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-18 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03  9:07 [PATCH v2] puppet: add recipe for puppet 3.7.3 YangHaibo
2014-12-03 15:21 ` Bruce Ashfield
2014-12-18 18:01   ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.