[node-patches] Change in ovirt-node[master]: Skeletonize the next-gen puppet requirements

rbarry at redhat.com rbarry at redhat.com
Wed Oct 1 18:47:26 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Skeletonize the next-gen puppet requirements
......................................................................

Skeletonize the next-gen puppet requirements

Add a new package which future modules can depend on. Add enough
hiera and facter configuration for node to isolate its operation
running masterless and not interfere with other puppetmasters

Change-Id: Ic0dfb17a06d9cbfa86c0be70c482a6aa9a7dff60
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M Makefile.am
M configure.ac
M ovirt-node.spec.in
A puppet/Makefile.am
A puppet/facts/ovirt-node.json
A puppet/hiera.yaml
A puppet/hieradata/node_private.json
7 files changed, 82 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/81/33681/1

diff --git a/Makefile.am b/Makefile.am
index 3c767e9..ec83b7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,6 +29,7 @@
   services \
   logrotate \
   plugins \
+	puppet \
   modules \
   registration \
   tools \
diff --git a/configure.ac b/configure.ac
index b179e29..45f40ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,7 @@
                 images/Makefile
                 scripts/Makefile
                 registration/Makefile
+                puppet/Makefile
                 tools/Makefile
                 scripts/collectd.conf
                 src/Makefile
diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 8e1890c..277337d 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -144,6 +144,21 @@
 This package is not to be installed on the %{product_family},
 however on a development machine to help to build the image.
 
+%package puppet-next-gen
+Summary:        Puppet plugin for %{product_family} image
+Group:          Applications/System
+Requires:       puppet
+Requires:       hiera
+
+%description puppet-next-gen
+This package provides bootstrapping for configuring and using the
+next-gen %{product_family} image by leveraging hiera and facter.
+
+%post puppet-next-gen
+# Link the hiera configs so the hiera command-line utility and hiera from
+# puppet show the same information
+ln -sf /etc/puppet/hiera.yaml /etc/hiera.yaml
+
 
 %package tools
 Summary:        Tools for working with plugins on %{product_family} images
@@ -664,6 +679,10 @@
 %{_mandir}/man8/node-creator.8.gz
 %{_sbindir}/node-creator
 
+%files puppet-next-gen
+%{_sysconfdir}/puppet/hiera.yaml
+%{_sysconfdir}/puppet/hieradata/node_private.json
+%{_sysconfdir}/puppet/facter/facts.d/ovirt-node.json
 
 %files tools
 %{_sbindir}/edit-node
diff --git a/puppet/Makefile.am b/puppet/Makefile.am
new file mode 100644
index 0000000..46b221b
--- /dev/null
+++ b/puppet/Makefile.am
@@ -0,0 +1,35 @@
+# Makefile.am - Copyright (C) 2014 Red Hat, Inc.
+# Written by Ryan Barry <rbarry at redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.  A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+puppetdir = $(sysconfdir)/puppet
+hieradir = $(puppetdir)/hieradata
+facterdir =$(puppetdir)/facter/facts.d
+pyovirtconfigbootdir = $(sysconfdir)/ovirt-config-boot.d
+pyovirtconfigbootargdir = $(sysconfdir)/ovirt-commandline.d
+puppetplugindir = ${prefix}/share/ovirt-node/puppet-plugin/
+rbovirtsetupdir = $(localstatedir)/lib/puppet/facts
+
+# FIXME this can be removed
+dist_puppet_DATA = \
+  hiera.yaml
+
+dist_facter_DATA = \
+  facts/ovirt-node.json
+
+dist_hiera_DATA = \
+  hieradata/node_private.json
diff --git a/puppet/facts/ovirt-node.json b/puppet/facts/ovirt-node.json
new file mode 100644
index 0000000..435cb9a
--- /dev/null
+++ b/puppet/facts/ovirt-node.json
@@ -0,0 +1,4 @@
+{
+    "role": "ovirt-node",
+    "node_environment": "node_private"
+}
diff --git a/puppet/hiera.yaml b/puppet/hiera.yaml
new file mode 100644
index 0000000..1771ddc
--- /dev/null
+++ b/puppet/hiera.yaml
@@ -0,0 +1,19 @@
+---
+:backends:
+  - json
+  - yaml
+:hierarchy:
+  - "%{node_environment}"
+  - defaults
+  - "%{clientcert}"
+  - "%{environment}"
+  - global
+:json:
+  :datadir: /etc/puppet/hieradata
+
+:yaml:
+# datadir is empty here, so hiera uses its defaults:
+# - /var/lib/hiera on *nix
+# - %CommonAppData%\PuppetLabs\hiera\var on Windows
+# When specifying a datadir, make sure the directory exists.
+  :datadir:
diff --git a/puppet/hieradata/node_private.json b/puppet/hieradata/node_private.json
new file mode 100644
index 0000000..10e8741
--- /dev/null
+++ b/puppet/hieradata/node_private.json
@@ -0,0 +1,3 @@
+{
+  "product" : "ovirt-node"
+}


-- 
To view, visit http://gerrit.ovirt.org/33681
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0dfb17a06d9cbfa86c0be70c482a6aa9a7dff60
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list