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
# | |
# Depends on: puppetlabs/stdlib | |
# | |
define buildsource( | |
$dir = $title, | |
$user = 'root', | |
$path = '/usr/bin:/bin', | |
$timeout = '0', | |
$options = '' | |
) { |
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
$subject = '/etc/sysconfig/authconfig' | |
$monitor = '/var/tmp/authconfig_monitor' | |
file { $subject: | |
ensure => file, | |
} | |
exec { "trigger on update to $subject": | |
provider => shell, | |
command => "date > $monitor && /bin/dostuff", |
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
$testvar = "" | |
if $testvar == undef { | |
notify { "testvar == undef": } | |
} | |
if $testvar == "" { | |
notify { 'testvar == ""': } | |
} |
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
#!/bin/sh | |
NEXUS=$HOME/supernexus | |
branch="PECVD_Master" | |
lock="/tmp/githooklock" | |
if mkdir $lock; then | |
echo "Locking nexus superproject succeeded" >&2 | |
else |
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
a_public_dns=$(host $(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) | sed 's/.*pointer \(.*\)\./\1/') | |
a_internal_dns=$(hostname | grep '\.' || hostname -f) | |
q_install=y | |
q_puppet_cloud_install=y | |
q_puppet_enterpriseconsole_auth_database_name=console_auth | |
q_puppet_enterpriseconsole_auth_database_password=r42lOr5jsWisAUbx6P8F | |
q_puppet_enterpriseconsole_auth_database_user=console_auth | |
q_puppet_enterpriseconsole_auth_password=puppetlabs | |
[email protected] | |
q_puppet_enterpriseconsole_database_install=y |
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
q_fail_on_unsuccessful_master_lookup=n | |
q_install=y | |
q_puppet_cloud_install=n | |
q_puppet_enterpriseconsole_install=n | |
q_puppet_symlinks_install=y | |
q_puppetagent_certname=`hostname` | |
q_puppetagent_install=y | |
q_puppetagent_server=puppet | |
q_puppetca_install=n | |
q_puppetmaster_install=n |
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
## Feature Request ## | |
The Puppet Enterprise installer when operating in unattended installation mode | |
(answers file) should facilitate the setting of custom facts via the | |
factor-dot-d system. The answers file should accept a variable prefix form | |
which specifies a custom fact to set. For example: | |
Given the answers file: | |
q_fail_on_unsuccessful_master_lookup=n |
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
# Our title_patterns method for mapping titles to namevars for supporting | |
# composite namevars. | |
def self.title_patterns | |
identity = lambda {|x| x} | |
[ | |
[ | |
/^([^:]+)$/, | |
[[ :name, identity ]] | |
], | |
[ |
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
def prefetch(resources = {}) | |
# generate hash of {provider_name => provider} | |
providers = instances.inject({}) do |hash, instance| | |
hash[instance.name] = instance | |
hash | |
end | |
# Identify the namevar(s) for the type | |
nv_properties = resource_type.properties.select(&:isnamevar?).map(&:name) | |
nv_params = resource_type.parameters.select do |param| |
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
# This custom fact pulls out all local users from the /etc/passwd file | |
# and returns the collection as a comma-separated list. | |
Facter.add(:local_users) do | |
setcode do | |
users = Array.new | |
File.open("/etc/passwd").each do |line| | |
next if line.match(/^\s|^#|^$/) | |
users << line.split(':').first | |
end |
OlderNewer