Skip to contentSkip to conversation

Fix the puppet run failure issue

PATCH Applied Mark Asselstine 2 participants 6 messages Aug 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 Fix the puppet run failure issue

From: Guojian Zhou <[email protected]>

The puppet's execution depends on the facter, so add the required RDEPENDS in the bb file.

The puppet tool run failure information:
==============================================

root@# puppet help
/usr/lib64/ruby/rubygems/custom_require.rb:36:in `require': cannot load such file -- facter (LoadError)
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/lib/puppet.rb:6:in `<top (required)>'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/lib/puppet/util/command_line.rb:12:in `<top (required)>'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/bin/puppet:7:in `<top (required)>'
from /usr/bin/puppet:23:in `load'
from /usr/bin/puppet:23:in `<main>'
---
 meta-openstack/recipes-support/puppet/puppet_3.7.3.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta-openstack/recipes-support/puppet/puppet_3.7.3.bb +6 -0
index afd9a23..22376cf 100644
@@ -18,6 +18,12 @@ DEPENDS += " \
         hiera \
 "
 
+RDEPENDS_${PN} += " \
+        ruby \
+        facter \
+        hiera \
+"
+
 RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
 
 do_install_append() {
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/5 Add the puppet.conf for the puppet agent

From: Guojian Zhou <[email protected]>

The puppet agent requires the /etc/puppet/puppet.conf.

---
 meta-openstack/recipes-support/puppet/puppet/puppet.conf | 9 +++++++++
 meta-openstack/recipes-support/puppet/puppet_3.7.3.bb    | 2 ++
 2 files changed, 11 insertions(+)
 create mode 100644 meta-openstack/recipes-support/puppet/puppet/puppet.conf
meta-openstack/recipes-support/puppet/puppet/puppet.conf new file +9 -0
new file mode 100644
index 0000000..efe143c
@@ -0,0 +1,9 @@
+[main]
+logdir=/var/log/puppet
+vardir=/var/lib/puppet
+ssldir=/var/lib/puppet/ssl
+rundir=/var/run/puppet
+factpath=$vardir/lib/facter
+
+[agent]
+server=puppet-server
meta-openstack/recipes-support/puppet/puppet_3.7.3.bb +2 -0
index 22376cf..f201a7b 100644
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=f257790c70561550fd666c6e0044fd89"
 SRC_URI = " \
     https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
     file://add_puppet_gemspec.patch \
+    file://puppet.conf \
 "
 SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
 SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
@@ -34,4 +35,5 @@ do_install_append() {
     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/
+    install -m 655 ${WORKDIR}/puppet.conf ${D}${sysconfdir}/puppet/
 }
Signature · 1 line
2.1.4
#2 lore raw

PATCH 3/5 Add the ruby-shadow recipe for the puppet tool

In reply to Mark Asselstine

From: Guojian Zhou <[email protected]>

The puppet could not add or change the user's password automatically, because the puppet tool requires the "libshadow" to implement this feature.

Failure information without the "libshadow" feature:
==================================================================
Debug: /User[username]: Provider useradd does not support features manages_passwords; not managing attribute password

---
 .../recipes-support/puppet/puppet_3.7.3.bb         |  1 +
 .../recipes-support/ruby-shadow/ruby-shadow_git.bb | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 meta-openstack/recipes-support/ruby-shadow/ruby-shadow_git.bb
meta-openstack/recipes-support/puppet/puppet_3.7.3.bb +1 -0
index f201a7b..c1743e6 100644
@@ -23,6 +23,7 @@ RDEPENDS_${PN} += " \
         ruby \
         facter \
         hiera \
+        ruby-shadow \
 "
 
 RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
meta-openstack/recipes-support/ruby-shadow/ruby-shadow_git.bb new file +23 -0
new file mode 100644
index 0000000..72be016
@@ -0,0 +1,23 @@
+SUMMARY = "Shadow Password Module"
+HOMEPAGE = "https://github.com/apalmblad/ruby-shadow"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=137882914e5269b7268f0fe8e28a3f89"
+
+PV = "2.4.1"
+
+SRC_URI = "git://github.com/apalmblad/ruby-shadow.git"
+SRCREV = "4231a4838fd50022b112838f114ee0586e119605"
+S = "${WORKDIR}/git"
+
+inherit ruby
+
+DEPENDS += " \
+        ruby \
+"
+
+RDEPENDS_${PN} += " \
+        ruby \
+"
+
+RUBY_INSTALL_GEMS = "ruby-shadow-${PV}.gem"
+FILES_${PN}-dbg += "/usr/lib64/ruby/gems/*/gems/ruby-shadow-${PV}/.debug/shadow.so"
Signature · 1 line
2.1.4
#3 lore raw

PATCH 4/5 puppet: move to base layer

In reply to Mark Asselstine

Puppet can be used by many 'cloud services', it is not openstack specific, so moving puppet and puppet related recipes to the meta-cloud-services base layer. This allows either internal sub-layers found in meta-cloud-services or external layers to include meta-cloud-services without being burdened by bbappends and configs found in meta-openstack.

---
 .../facter/facter/add_facter_gemspec.patch                                | 0
 .../recipes-support => recipes-support}/facter/facter_2.3.0.bb            | 0
 .../hiera/hiera/add_hiera_gemspec.patch                                   | 0
 {meta-openstack/recipes-support => recipes-support}/hiera/hiera_1.3.4.bb  | 0
 {meta-openstack/recipes-support => recipes-support}/puppet/README         | 0
 .../puppet/puppet/add_puppet_gemspec.patch                                | 0
 .../recipes-support => recipes-support}/puppet/puppet/puppet.conf         | 0
 .../recipes-support => recipes-support}/puppet/puppet_3.7.3.bb            | 0
 .../recipes-support => recipes-support}/ruby-shadow/ruby-shadow_git.bb    | 0
 9 files changed, 0 insertions(+), 0 deletions(-)
 rename {meta-openstack/recipes-support => recipes-support}/facter/facter/add_facter_gemspec.patch (100%)
 rename {meta-openstack/recipes-support => recipes-support}/facter/facter_2.3.0.bb (100%)
 rename {meta-openstack/recipes-support => recipes-support}/hiera/hiera/add_hiera_gemspec.patch (100%)
 rename {meta-openstack/recipes-support => recipes-support}/hiera/hiera_1.3.4.bb (100%)
 rename {meta-openstack/recipes-support => recipes-support}/puppet/README (100%)
 rename {meta-openstack/recipes-support => recipes-support}/puppet/puppet/add_puppet_gemspec.patch (100%)
 rename {meta-openstack/recipes-support => recipes-support}/puppet/puppet/puppet.conf (100%)
 rename {meta-openstack/recipes-support => recipes-support}/puppet/puppet_3.7.3.bb (100%)
 rename {meta-openstack/recipes-support => recipes-support}/ruby-shadow/ruby-shadow_git.bb (100%)
recipes-support/facter/facter/add_facter_gemspec.patch renamed from meta-openstack/recipes-support/facter/facter/add_facter_gemspec.patch +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/facter/facter/add_facter_gemspec.patch
rename to recipes-support/facter/facter/add_facter_gemspec.patch
recipes-support/facter/facter_2.3.0.bb renamed from meta-openstack/recipes-support/facter/facter_2.3.0.bb +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/facter/facter_2.3.0.bb
rename to recipes-support/facter/facter_2.3.0.bb
recipes-support/hiera/hiera/add_hiera_gemspec.patch renamed from meta-openstack/recipes-support/hiera/hiera/add_hiera_gemspec.patch +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/hiera/hiera/add_hiera_gemspec.patch
rename to recipes-support/hiera/hiera/add_hiera_gemspec.patch
recipes-support/hiera/hiera_1.3.4.bb renamed from meta-openstack/recipes-support/hiera/hiera_1.3.4.bb +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/hiera/hiera_1.3.4.bb
rename to recipes-support/hiera/hiera_1.3.4.bb
recipes-support/puppet/README renamed from meta-openstack/recipes-support/puppet/README +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/puppet/README
rename to recipes-support/puppet/README
recipes-support/puppet/puppet/add_puppet_gemspec.patch renamed from meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/puppet/puppet/add_puppet_gemspec.patch
rename to recipes-support/puppet/puppet/add_puppet_gemspec.patch
recipes-support/puppet/puppet/puppet.conf renamed from meta-openstack/recipes-support/puppet/puppet/puppet.conf +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/puppet/puppet/puppet.conf
rename to recipes-support/puppet/puppet/puppet.conf
recipes-support/puppet/puppet_3.7.3.bb renamed from meta-openstack/recipes-support/puppet/puppet_3.7.3.bb +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/puppet/puppet_3.7.3.bb
rename to recipes-support/puppet/puppet_3.7.3.bb
recipes-support/ruby-shadow/ruby-shadow_git.bb renamed from meta-openstack/recipes-support/ruby-shadow/ruby-shadow_git.bb +0 -0
similarity index 100%
rename from meta-openstack/recipes-support/ruby-shadow/ruby-shadow_git.bb
rename to recipes-support/ruby-shadow/ruby-shadow_git.bb
Signature · 1 line
2.1.4
#4 lore raw

PATCH 5/5 puppet: fixup QA warning

In reply to Mark Asselstine

Currently we get the following warning when building puppet:

WARNING: QA Issue: /usr/lib/ruby/gems/2.2.0/gems/puppet-3.7.3/ lib/puppet/vendor/safe@underscore@yaml/run@underscore@specs@ underscore@all@underscore@ruby@[email protected]_puppet contained in package puppet requires /bin/bash, but no providers found in its RDEPENDS [file-rdeps]

Adding 'bash' as an RDEPENDS fixes this.

---
 recipes-support/puppet/puppet_3.7.3.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-support/puppet/puppet_3.7.3.bb +1 -0
index c1743e6..14e18d9 100644
@@ -24,6 +24,7 @@ RDEPENDS_${PN} += " \
         facter \
         hiera \
         ruby-shadow \
+        bash \
 "
 
 RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
Signature · 1 line
2.1.4
#5 lore raw
In reply to Mark Asselstine
Quoted 4 lines · Mark Asselstine

From: Guojian Zhou <[email protected]>

The puppet's execution depends on the facter, so add the required RDEPENDS in the bb file.

merged to master.

Bruce

Quoted 40 lines

The puppet tool run failure information:
==============================================

root@# puppet help
/usr/lib64/ruby/rubygems/custom_require.rb:36:in `require': cannot load such file -- facter (LoadError)
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/lib/puppet.rb:6:in `<top (required)>'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/lib/puppet/util/command_line.rb:12:in `<top (required)>'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/puppet-3.7.3/bin/puppet:7:in `<top (required)>'
from /usr/bin/puppet:23:in `load'
from /usr/bin/puppet:23:in `<main>'
---
  meta-openstack/recipes-support/puppet/puppet_3.7.3.bb | 6 ++++++
  1 file changed, 6 insertions(+)
meta-openstack/recipes-support/puppet/puppet_3.7.3.bb +6 -0
index afd9a23..22376cf 100644
@@ -18,6 +18,12 @@ DEPENDS += " \
          hiera \
  "
 
+RDEPENDS_${PN} += " \
+        ruby \
+        facter \
+        hiera \
+"
+
  RUBY_INSTALL_GEMS = "puppet-${PV}.gem"
 
  do_install_append() {