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
$install_dir = '/opt/cloud-private-ce' | |
$public_ip = $facts[ipaddress] | |
$shared_root_password = 'puppetlabs' | |
$shared_root_pw_hash = '$6$bdVLCr58$TtGGFM8FH9jhSL6ZB9gXHncCm30gMKcHER.ByqL6zAMjarUVtSZ.SqKfhw7ip5NKR0iRVC8/Gx5KrMfrb1GSP0' | |
$config_yaml = @("END") | |
--- | |
ansible_user: root | |
ansible_ssh_pass: $shared_root_password | |
ansible_ssh_common_args: "-oPubkeyAuthentication=no" |
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/bash | |
GET_FACTS_FROM_CERTNAME="win-2016-49.inf.puppet.vm" | |
CERTNAME_FOR_OUTPUT="mission-3" | |
FAKE_NODES="fake-nodes.localdomain" | |
#make sure jq and rhino javascript installed | |
jq_path=$(which jq 2> /tmp/get-win-facts.log) | |
if [ -x "$jq_path" ] ; then | |
echo "jq is installed: $jq_path" >> /tmp/get-win-facts.log |
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
facts = [ | |
{ | |
"name": "processors", | |
"value": "{\"isa\":\"x64\",\"count\":4,\"models\":[\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\"],\"physicalcount\":4}", | |
"environment": "production", | |
"id": "mission-3-processors" | |
} | |
] |
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
function prettyStructured (k,v) { | |
try {if (k == "value" && typeof(JSON.parse(v)) == "object") { | |
v = JSON.stringify(JSON.parse(v), null, 2).replace(/\n/g, "\n"); | |
} } catch(e) {} | |
return v; | |
} | |
JSON.stringify(facts, prettyStructured ,2) | |
facts = [ ... |
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
master="master.inf.puppet.vm" | |
# copy what will be pluginsync'd to non-root agents to avoid some overhead (still checksum overhead, but no file copy over network). | |
# we copy the lib and facts.d dirs | |
libcache="/tmp/libcache" | |
declare -a arr=("centos7" "server2012r2" "win-2016" "ubuntu1404" "ubuntu1604") | |
start_num=5 | |
end_num=26 | |
for i in "${arr[@]}"; do |
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
#!/opt/puppetlabs/puppet/bin/ruby | |
require 'json' | |
puppet = '/opt/puppetlabs/bin/puppet' | |
today = %x(date +%Y-%m-%d).chomp | |
nodes_json = JSON.parse(%x(#{puppet} query 'nodes[certname] { deactivated is null }')) | |
nodes_list = nodes_json.map { |n| n.values }.flatten |
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
--- | |
version: 5 | |
hierarchy: | |
- name: "Classifier Configuration Data" | |
data_hash: classifier_data | |
- name: yaml | |
data_hash: yaml_data | |
datadir: /etc/puppetlabs/code/environments/%{environment}/hieradata | |
paths: | |
- "nodes/%{clientcert}.yaml" |
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
--- | |
resources: | |
File[/usr/local]: | |
parameters: | |
ensure: | |
system_value: | |
- :directory | |
seluser: | |
system_value: | |
- system_u |
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
--- | |
resources: | |
File[/usr/local]: | |
parameters: | |
ensure: | |
system_value: | |
- :directory | |
seluser: | |
system_value: | |
- system_u |
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
--- | |
resources: | |
File[/usr/local]: | |
parameters: | |
ensure: | |
system_value: | |
- :directory | |
seluser: | |
system_value: | |
- system_u |