diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-06-07 13:00:46 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-06-07 14:36:54 -0700 |
| commit | 3f0dbb5fb7d9f4d88684fa07189270f42074e5f4 (patch) | |
| tree | be74d7e692c9d17dfe2b3acb661e4c11f5791aa3 /acceptance/tests | |
| parent | c260cf1c8f4850fb5e81616c1e4baa2a42c063e9 (diff) | |
| download | puppet-3f0dbb5fb7d9f4d88684fa07189270f42074e5f4.tar.gz puppet-3f0dbb5fb7d9f4d88684fa07189270f42074e5f4.tar.xz puppet-3f0dbb5fb7d9f4d88684fa07189270f42074e5f4.zip | |
(#650) Allow symlinks for configuration directories
Previously, pointing a setting like 'confdir' at a symlink to a directory would
replace the symlink with a directory. This was because files created by
settings implicitly managed links, rather than following them. This behavior is
now changed so that file settings will follow links.
The behavior of these symlinks is the same as any other file resource. That is,
if the target of the symlink doesn't exist, Puppet will consider this an
error. Similarly, if the target of the symlink is a file, then the symlink
will still be replaced with a directory, rather than replacing its target.
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
Reviewed-By: Dominic Maraglia <dominic@puppetlabs.com>
Diffstat (limited to 'acceptance/tests')
| -rw-r--r-- | acceptance/tests/allow_symlinks_as_config_directories.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/acceptance/tests/allow_symlinks_as_config_directories.rb b/acceptance/tests/allow_symlinks_as_config_directories.rb new file mode 100644 index 000000000..66c6ccca0 --- /dev/null +++ b/acceptance/tests/allow_symlinks_as_config_directories.rb @@ -0,0 +1,27 @@ +test_name "Should allow symlinks to directories as configuration directories" + +step "Create the test confdir with a link to it" +confdir = "/tmp/puppet_conf-directory-#{$$}" +conflink = "/tmp/puppet_conf-symlink-#{$$}" + +on agents, "rm -rf #{conflink} #{confdir}" + +on agents, "mkdir #{confdir}" +on agents, "ln -s #{confdir} #{conflink}" + +create_remote_file agents, "#{confdir}/puppet.conf", <<CONFFILE +[main] +certname = "awesome_certname" +CONFFILE + +manifest = 'notify{"My certname is $clientcert": }' + +step "Run Puppet and ensure it used the conf file in the confdir" +on agents, puppet_apply("--confdir #{conflink}"), :stdin => manifest do + assert_match("My certname is awesome_certname", stdout) +end + +step "Check that the symlink and confdir are unchanged" +on agents, "[ -L #{conflink} ]" +on agents, "[ -d #{confdir} ]" +on agents, "[ $(readlink #{conflink}) = #{confdir} ]" |
