From bf503ee95e4061a49c1a5c376c1144ae0918d37b Mon Sep 17 00:00:00 2001 From: Yannick Denzer Date: Mon, 29 Jan 2018 15:44:35 +0100 Subject: [PATCH 1/2] Add basic support for Gentoo and Solaris --- manifests/defaults.pp | 8 ++++++++ metadata.json | 14 ++++++++++++++ spec/classes/puppet_agent_spec.rb | 4 ++++ spec/classes/puppet_config_spec.rb | 4 ++++ spec/classes/puppet_master_server_spec.rb | 4 ++++ 5 files changed, 34 insertions(+) diff --git a/manifests/defaults.pp b/manifests/defaults.pp index 02410cf..bd3b070 100644 --- a/manifests/defaults.pp +++ b/manifests/defaults.pp @@ -14,6 +14,14 @@ class puppet::defaults { case $::osfamily { + 'Gentoo' : { + $puppetmaster_pkg = 'puppet' + $sysconfigdir = '/etc/default' + } + 'Solaris' : { + $puppetmaster_pkg = 'system/management/puppet' + $sysconfigdir = '/etc/default' + } 'Debian' : { $puppetmaster_pkg = 'puppetmaster' $sysconfigdir = '/etc/default' diff --git a/metadata.json b/metadata.json index 2970c20..d408dc8 100644 --- a/metadata.json +++ b/metadata.json @@ -9,6 +9,20 @@ "issues_url": "https://github.com/abstractitptyltd/abstractit-puppet/issues", "tags": ["puppet","hiera","facter","puppet-agent","puppetserver","puppetdb","r10k"], "operatingsystem_support": [ + { + "operatingsystem": "Gentoo", + "operatingsystemrelease": [ + "2", + "4" + ] + }, + { + "operatingsystem": "Solaris", + "operatingsystemrelease": [ + "5", + "11" + ] + }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ diff --git a/spec/classes/puppet_agent_spec.rb b/spec/classes/puppet_agent_spec.rb index 74c79d1..e719c4a 100644 --- a/spec/classes/puppet_agent_spec.rb +++ b/spec/classes/puppet_agent_spec.rb @@ -36,6 +36,10 @@ bin_dir = '/usr/bin' end case facts[:osfamily] + when 'Gentoo' + sysconfigdir = '/etc/default' + when 'Solaris' + sysconfigdir = '/etc/default' when 'Debian' sysconfigdir = '/etc/default' when 'RedHat' diff --git a/spec/classes/puppet_config_spec.rb b/spec/classes/puppet_config_spec.rb index 37cb28b..015e84d 100644 --- a/spec/classes/puppet_config_spec.rb +++ b/spec/classes/puppet_config_spec.rb @@ -37,6 +37,10 @@ confdir = '/etc/puppet' end case facts[:osfamily] + when 'Gentoo' + sysconfigdir = '/etc/default' + when 'Solaris' + sysconfigdir = '/etc/default' when 'Debian' sysconfigdir = '/etc/default' when 'RedHat' diff --git a/spec/classes/puppet_master_server_spec.rb b/spec/classes/puppet_master_server_spec.rb index 969ec33..a9d3599 100644 --- a/spec/classes/puppet_master_server_spec.rb +++ b/spec/classes/puppet_master_server_spec.rb @@ -39,6 +39,10 @@ basemodulepath = "#{confdir}/modules:/usr/share/puppet/modules" end case facts[:osfamily] + when 'Gentoo' + sysconfigdir = '/etc/default' + when 'Solaris' + sysconfigdir = '/etc/default' when 'Debian' sysconfigdir = '/etc/default' when 'RedHat' From 16d791aea16f0cf4cbd48245738d000effef6725 Mon Sep 17 00:00:00 2001 From: Yannick Denzer Date: Mon, 29 Jan 2018 16:18:30 +0100 Subject: [PATCH 2/2] Fix facter path for Solaris --- manifests/defaults.pp | 9 +++++++-- spec/classes/puppet_facts_spec.rb | 7 ++++++- spec/classes/puppet_spec.rb | 7 ++++++- spec/defines/fact_spec.rb | 7 ++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/manifests/defaults.pp b/manifests/defaults.pp index bd3b070..817bcd6 100644 --- a/manifests/defaults.pp +++ b/manifests/defaults.pp @@ -46,8 +46,13 @@ 'datadir' => '/etc/puppetlabs/code/hieradata/%{environment}' } } - $facterbasepath = '/opt/puppetlabs/facter' - $reports_dir = '/opt/puppetlabs/server/data/reports' + if $::osfamily == 'Solaris' { + $facterbasepath = '/var/puppetlabs/puppet/cache' + $reports_dir = '/var/puppetlabs/puppet/cache/reports' + } else { + $facterbasepath = '/opt/puppetlabs/facter' + $reports_dir = '/opt/puppetlabs/server/data/reports' + } $terminus_package = 'puppetdb-termini' $puppetdb_etcdir = '/etc/puppetlabs/puppetdb' $puppetdb_test_url = '/pdb/meta/v1/version' diff --git a/spec/classes/puppet_facts_spec.rb b/spec/classes/puppet_facts_spec.rb index 581cbac..e6cc596 100644 --- a/spec/classes/puppet_facts_spec.rb +++ b/spec/classes/puppet_facts_spec.rb @@ -82,7 +82,12 @@ end it { is_expected.to compile.with_all_deps } if Puppet.version.to_f >= 4.0 - facterbasepath = '/opt/puppetlabs/facter' + case facts[:osfamily] + when 'Solaris' + facterbasepath = '/var/puppetlabs/puppet/cache' + else + facterbasepath = '/opt/puppetlabs/facter' + end else facterbasepath = '/etc/facter' end diff --git a/spec/classes/puppet_spec.rb b/spec/classes/puppet_spec.rb index 7383db6..5c2ac8e 100644 --- a/spec/classes/puppet_spec.rb +++ b/spec/classes/puppet_spec.rb @@ -105,7 +105,12 @@ end it { is_expected.to compile.with_all_deps } if Puppet.version.to_f >= 4.0 - facterbasepath = '/opt/puppetlabs/facter' + case facts[:osfamily] + when 'Solaris' + facterbasepath = '/var/puppetlabs/puppet/cache' + else + facterbasepath = '/opt/puppetlabs/facter' + end facterbasepath_group = 'root' else facterbasepath = '/etc/facter' diff --git a/spec/defines/fact_spec.rb b/spec/defines/fact_spec.rb index d7831a3..7bcaae8 100644 --- a/spec/defines/fact_spec.rb +++ b/spec/defines/fact_spec.rb @@ -78,7 +78,12 @@ end if Puppet.version.to_f >= 4.0 - facterbasepath = '/opt/puppetlabs/facter' + case facts[:osfamily] + when 'Solaris' + facterbasepath = '/var/puppetlabs/puppet/cache' + else + facterbasepath = '/opt/puppetlabs/facter' + end facterbasepath_group = 'root' else facterbasepath = '/etc/facter'