Duncan Hutty
2012-Sep-06 14:56 UTC
[Puppet Users] puppetlabs-nginx: manifest change does not always result in config change
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I''m not sure, but I think I''ve come across a bug in the puppetlabs-nginx module. Changing the manifest does not always change the resulting nginx config. Here''s a fairly minimal example, if I have: node foo { nginx::resource::vhost { ''foo.example.com'': ensure => present, www_root => ''/opt/foogeneral/share/html'', } } I get valid nginx vhost config in vhost_autogen.conf. If I then change the manifest as follows and re-run puppet apply, I get *no* change to vhost_autogen.conf. nginx::resource::vhost { ''foo.example.com'': ensure => present, www_root => ''/opt/foogeneral/share/html'', ssl => true, ssl_cert => ''/tmp/server.crt'', ssl_key => ''/root/server.key'', } Furthermore, if I manually `rm /etc/nginx/conf.d/vhost_autogen.conf`, it does not get recreated, which results in a broken, invalid nginx config. I can cause it to be recreated by also removing the temporary location that is used to assemble this file, /tmp/nginx.d. I''m not sure whether adding ssl attributes is the only situation that results in no change in the nginx config. By contrast, for example, if I change the value of the www_root attribute, the config is changed as expected. I don''t think this is the desired behaviour as described in the documentation in https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/resource/vhost.pp. It''s certainly not what I''m looking for. I have an old nginx module that I wrote that is badly unconventional in various ways, so I wanted to switch to a puppetlabs module, but this appears to be broken. Can anyone confirm whether I''m correct or whether I''m just doing it wrong somehow? fedora17 puppet: 2.7.18 puppetlabs-nginx: 0.0.1 - -- Duncan Hutty http://www.allgoodbits.org -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBIuYQACgkQCFuTFybf1woKzACdE2xA2a+9y3+lsI28xcDCeB55 N1gAoIcYhCYk+pBD1pFdjHecRNUYUv5K =ltca -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Duncan Hutty
2012-Sep-11 20:52 UTC
Re: [Puppet Users] puppetlabs-nginx: manifest change does not always result in config change
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 9/6/12 10:56 AM, Duncan Hutty wrote:> > I''m not sure, but I think I''ve come across a bug in the > puppetlabs-nginx module. > > Changing the manifest does not always change the resulting nginx > config. Here''s a fairly minimal example, if I have: > > node foo { nginx::resource::vhost { ''foo.example.com'': ensure => > present, www_root => ''/opt/foogeneral/share/html'', } }Responding to myself for posterity and to nudge puppetlabs devs. In manifests/service.pp, we see: exec { ''rebuild-nginx-vhosts'': command => "/bin/cat ${nginx::params::nx_temp_dir}/nginx.d/* > ${nginx::params::nx_conf_dir}/conf.d/vhost_autogen.conf", refreshonly => true, subscribe => File["${nginx::params::nx_temp_dir}/nginx.d"], } I think that the subscribe is going to only cause the exec to be refreshed if the directory is changed, not if any of the *files* in the directory are changed. Can anyone confirm or deny my understanding of subscribe for a directory? - -- Duncan Hutty http://www.allgoodbits.org -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBPpHcACgkQCFuTFybf1wr+CQCfXnURoVvovXKqyiqFjcwMA8Y4 dyMAn2qEGOm+OEYIzs4wKP+mJkrHeZ+h =xAjU -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.