From 4e2a2b81cf17909647728a0c9febab7ab0370e65 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 13 Jan 2015 16:42:06 -0800 Subject: Initial Commit Stole Gary's puppet_repository and modified it for general general consumption. Upped the version of r10k to newest (1.4.1) Ripped out the hiera examples just left defaults.yaml Tweaked environment.conf --- manifests/site.pp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 manifests/site.pp (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp new file mode 100644 index 0000000..d52e944 --- /dev/null +++ b/manifests/site.pp @@ -0,0 +1,44 @@ + +## site.pp ## + +# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point +# used when an agent connects to a master and asks for an updated configuration. +# +# Global objects like filebuckets and resource defaults should go in this file, +# as should the default node definition. (The default node can be omitted +# if you use the console and don't define any other nodes in site.pp. See +# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on +# node definitions.) + +## Active Configurations ## + +# PRIMARY FILEBUCKET +# This configures puppet agent and puppet inspect to back up file contents when +# they run. The Puppet Enterprise console needs this to display file contents +# and differences. + +# Define filebucket 'main': +filebucket { 'main': + #server should point to one master that will be the file bucket + server => 'changeme', + path => false, +} + +# Make filebucket 'main' the default backup location for all File resources: +File { backup => 'main' } + +# DEFAULT NODE +# Node definitions in this file are merged with node data from the console. See +# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on +# node definitions. + +# The default node definition matches any node lacking a more specific node +# definition. If there are no other nodes in this file, classes declared here +# will be included in every node's catalog, *in addition* to any classes +# specified in the console for that node. + +node default { + # This is where you can declare classes for all nodes. + # Example: + # class { 'my_class': } +} -- cgit v1.2.3 From 4fa14545f65dd1286c89d966339cdf2de6bf672d Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Mon, 11 May 2015 15:28:42 -0700 Subject: Update site.pp to work OOTB --- manifests/site.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp index d52e944..b3319bd 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -20,7 +20,7 @@ # Define filebucket 'main': filebucket { 'main': #server should point to one master that will be the file bucket - server => 'changeme', + server => "${settings::server}", path => false, } -- cgit v1.2.3 From 921c83736ee9ec1ff48d3e18137292bb38829262 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Mon, 3 Aug 2015 17:24:41 -0700 Subject: Update site.pp to use a trusted fact role Allow including a role if defined via a trusted fact on the node during provisioning time. This is how I will bootstrap any necessary configuration on the master, or other PE internal nodes. --- manifests/site.pp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp index b3319bd..cc02727 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -38,6 +38,11 @@ File { backup => 'main' } # specified in the console for that node. node default { + #incude a role on any node that specifies it's role via a trusted fact at provision time + #https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#trusted-facts + #https://docs.puppetlabs.com/puppet/latest/reference/ssl_attributes_extensions.html#aws-attributes-and-extensions-population-example + include $trusted['extensions']['pp_role'] + # This is where you can declare classes for all nodes. # Example: # class { 'my_class': } -- cgit v1.2.3 From 70690333eedbb28b3f286912e6d9749b4a7e2618 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 13 Aug 2015 15:41:11 -0700 Subject: Fix some quoting issues and add role:: to the include in site.pp --- manifests/site.pp | 2 +- site/profile/manifests/puppetmaster.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp index cc02727..5ba0af4 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -41,7 +41,7 @@ node default { #incude a role on any node that specifies it's role via a trusted fact at provision time #https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#trusted-facts #https://docs.puppetlabs.com/puppet/latest/reference/ssl_attributes_extensions.html#aws-attributes-and-extensions-population-example - include $trusted['extensions']['pp_role'] + include "role::${trusted['extensions']['pp_role']}" # This is where you can declare classes for all nodes. # Example: diff --git a/site/profile/manifests/puppetmaster.pp b/site/profile/manifests/puppetmaster.pp index 8242110..b22500c 100644 --- a/site/profile/manifests/puppetmaster.pp +++ b/site/profile/manifests/puppetmaster.pp @@ -2,11 +2,11 @@ class profile::puppetmaster { class { 'hiera': hierarchy => [ - "nodes/%{::trusted.certname}", - :common", + "\"nodes/%{::trusted.certname}\"", + "common", ], hiera_yaml => '/etc/puppetlabs/code/hiera.yaml', - datadir => "/etc/puppetlabs/code/environments/%{environment}/hieradata", + datadir => "\"/etc/puppetlabs/code/environments/%{environment}/hieradata\"", owner => 'root', group => 'root', } -- cgit v1.2.3 From 9d1b750d743a4060101949de41838fec61985862 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 22 Oct 2015 14:15:13 -0700 Subject: fix site.pp to not include a role that is empty --- manifests/site.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp index 5ba0af4..7f7b8db 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -41,7 +41,10 @@ node default { #incude a role on any node that specifies it's role via a trusted fact at provision time #https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#trusted-facts #https://docs.puppetlabs.com/puppet/latest/reference/ssl_attributes_extensions.html#aws-attributes-and-extensions-population-example - include "role::${trusted['extensions']['pp_role']}" + + if !empty( ${trusted['extensions']['pp_role']} ) { + include "role::${trusted['extensions']['pp_role']}" + } # This is where you can declare classes for all nodes. # Example: -- cgit v1.2.3 From 86cb66b057c0d2c45519f0cdceb28206528c7e1b Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 22 Oct 2015 14:25:17 -0700 Subject: fix incorrect curly brace --- manifests/site.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/site.pp b/manifests/site.pp index 7f7b8db..5442bc0 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -42,7 +42,7 @@ node default { #https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#trusted-facts #https://docs.puppetlabs.com/puppet/latest/reference/ssl_attributes_extensions.html#aws-attributes-and-extensions-population-example - if !empty( ${trusted['extensions']['pp_role']} ) { + if !empty( $trusted['extensions']['pp_role'] ) { include "role::${trusted['extensions']['pp_role']}" } -- cgit v1.2.3