Created
October 1, 2015 10:54
-
-
Save Tombar/e8112eadbb0f4e5b7035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class btngbase::facter::extras { | |
if ! defined(File['/etc/facter/facts.d/']){ | |
if ! defined(File['/etc/facter/']){ | |
file { '/etc/facter': | |
ensure => 'directory', | |
mode => '0755', | |
owner => 'puppet', | |
group => 'puppet' | |
} | |
} | |
file { '/etc/facter/facts.d/': | |
ensure => 'directory', | |
mode => '0755', | |
owner => 'puppet', | |
group => 'puppet', | |
require => File['/etc/facter/'] | |
} | |
} | |
file { '/etc/facter/facts.d/env.sh': | |
ensure => present, | |
content => " grep environment /etc/puppet/puppet.conf | sed 's/environment/btng_env/' ", | |
mode => '0755', | |
owner => 'puppet', | |
group => 'puppet', | |
require => File['/etc/facter/facts.d'] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Class: rundeck::facts | |
# | |
# Class to add some facts for rundeck. They have been added as an external fact | |
# because we do not want to distrubute these facts to all systems. | |
# | |
# === Parameters | |
# | |
# [*ensure*] - ensure that these facts are added to the system | |
# | |
# === Examples | |
# | |
# class { 'rundeck::facts': } | |
# | |
class rundeck::facts( | |
$ensure = 'present', | |
) { | |
if $::puppetversion =~ /Puppet Enterprise/ { | |
$ruby_bin = '/opt/puppet/bin/ruby' | |
$dir = 'puppetlabs/' | |
} else { | |
$ruby_bin = '/usr/bin/env ruby' | |
$dir = '' | |
} | |
if ! defined(File["/etc/${dir}facter"]) { | |
file { "/etc/${dir}facter": | |
ensure => directory, | |
} | |
} | |
if ! defined(File["/etc/${dir}facter/facts.d"]) { | |
file { "/etc/${dir}facter/facts.d": | |
ensure => directory, | |
} | |
} | |
file { "/etc/${dir}facter/facts.d/rundeck_facts.rb": | |
ensure => $ensure, | |
content => template('rundeck/facts.rb.erb'), | |
mode => '0500', | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Failed to apply catalog: Duplicate declaration: File[/etc/facter/facts.d] is already declared in file /etc/puppet/environments/infradev/modules/btngbase/manifests/facter/extras.pp:20; cannot redeclare at /etc/puppet/environments/infradev/modules/rundeck/manifests/facts.pp:34 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment