-
-
Save endzyme/f41f2e049b21872f7ce0 to your computer and use it in GitHub Desktop.
Puppet Hiera Intro - Getting Started (Basic output example)
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
--- | |
ntp::service_enable: false | |
ntp::service_ensure: 'stopped' | |
apache::default_vhost: false | |
apache::vhosts: | |
'subdomain.loc': | |
priority: 1 | |
port: '80' | |
docroot: '/var/www/newdir' | |
'subdomain2.loc': | |
priority: 2 | |
port: 8080 | |
docroot: '/var/www/somethingelse' |
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
--- | |
ntp::service_enable: true | |
ntp::service_ensure: 'running' | |
ntp::autoupdate: false | |
ntp::servers: | |
- 0.us.pool.ntp.org | |
- 1.us.pool.ntp.org |
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
--- | |
:backends: | |
- yaml | |
:yaml: | |
:datadir: /etc/puppet/manifests/data | |
:hierarchy: | |
- %{::clientcert} | |
- %{::environment} | |
- common | |
:logger: console |
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
--- | |
ntp::autoupdate: true | |
ntp::servers: | |
- '0.us.pool.ntp.org' | |
- '1.us.pool.ntp.org' | |
- '2.us.pool.ntp.org' | |
- '3.us.pool.ntp.org' |
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
--- | |
ntp::service_enable: true | |
ntp::service_ensure: 'running' | |
ntp::autoupdate: true | |
ntp::servers: | |
- ntp.ubuntu.com |
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
node /ntp(\d+)?.localhost/ { | |
include ntp | |
} | |
node /apache(\d+)?.localhost/ { | |
include ntp | |
include apache | |
$resource = hiera('apache::vhosts') | |
create_resources('apache::vhost', $resource) | |
} |
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
for i in `find . -name '*.yaml'` ;do echo $i ; ruby -e "require 'yaml'; YAML.parse(File.open('$i'))" ;done |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
exit_code = 0 | |
if ARGV.length != 1 | |
puts "Usage: ruby validate_ymls.rb directory_absolute_path" | |
exit! | |
end | |
base_path = ARGV[0].chomp("/") | |
base_dir = Dir.glob("#{base_path}/**/*.yaml") + Dir.glob("#{base_path}/**/*.yml") | |
base_dir.each do |file_name| | |
#puts "validating #{file_name}" | |
begin | |
env_constants = YAML::load(open(file_name)) | |
rescue Exception => e | |
puts "ERROR!!! #{file_name} contains error! Message: #{e.message}" | |
exit_code = 1 | |
end | |
end | |
if exit_code == 0 | |
puts "No Errors Detected in loading |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment