1
test_name "node_name_fact should be used to determine the node name for puppet agent"
3
success_message = "node_name_fact setting was correctly used to determine the node name"
7
on agents, facter('kernel') do
8
node_names << stdout.chomp
13
authfile = "/tmp/auth.conf-2128-#{$$}"
14
authconf = node_names.map do |node_name|
16
path /catalog/#{node_name}
22
manifest_file = "/tmp/node_name_value-test-#{$$}.pp"
24
Exec { path => "/usr/bin:/bin" }
29
manifest << node_names.map do |node_name|
32
exec { "echo #{success_message}": }
37
create_remote_file master, authfile, authconf
38
create_remote_file master, manifest_file, manifest
40
on master, "chmod 644 #{authfile} #{manifest_file}"
42
with_master_running_on(master, "--rest_authconfig #{authfile} --manifest #{manifest_file} --daemonize --dns_alt_names=\"puppet, $(hostname -s), $(hostname -f)\" --autosign true") do
43
run_agent_on(agents, "--no-daemonize --verbose --onetime --node_name_fact kernel --server #{master}") do
44
assert_match(success_message, stdout)