Skip to content

Instantly share code, notes, and snippets.

View heliocentric's full-sized avatar

Dylan Cochran heliocentric

View GitHub Profile
config.vm.hostname = "mom.test"
config.vm.provision "shell", inline: <<-SHELL
sudo yum install -y https://yum.puppetlabs.com/puppet5/puppet5-release-el-7.noarch.rpm
sudo yum install puppet-agent -y
sudo /opt/puppetlabs/puppet/bin/gem install r10k
sudo /opt/puppetlabs/puppet/bin/r10k deploy -c /vagrant/r10k.yaml environment production -pv
yum -y install puppetserver
sudo mkdir -p /etc/puppetlabs/puppetserver
sudo echo "*" > /etc/puppetlabs/puppet/autosign.conf
sudo systemctl enable puppetserver
---
.cache_bundler: &cache_bundler
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- '.vendor'
- 'vendor'
.setup_bundler_env: &setup_bundler_env
@heliocentric
heliocentric / file_backend.rb
Last active August 22, 2017 20:46
file_backend.rb
Puppet::Functions.create_function(:'file_backend') do
dispatch :file_backend do
param "String", :key
param "Hash", :options
param "Puppet::LookupContext", :context
end
def file_backend(key, options, context)
if (options.key?("directory"))
dir = context.interpolate(options["directory"])
if (File.exists?("#{dir}/#{key}")
$haproxy_servers = {
"test" => {
"host" => "test1",
"stuff" => "test2",
},
"jump" => {
"host" => "jump1",
"stuff" => "jump2",
}
}
puppet query 'fact_contents { path ~> ["os", "name"] }' | jq -r 'map(["os.name",.certname, .value]) | .[] | @csv'
{
C7.0.1406-base => {
ensure => "present",
baseurl => "http://vault.centos.org/7.0.1406/os/$basearch/",
descr => "CentOS-7.0.1406 - Base",
enabled => "0",
gpgcheck => "1",
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7",
provider => "inifile"
},