Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Is there a such a thing as a conditional subscribe?

$
0
0
I have a situation in my puppet enterprise 3.7 manifest where I could use a conditional 'subscribe' from my service to a file. I get this error message ... Invalid relationship: Service[openstack-cinder-api] { subscribe => File[/etc/cinder/nfs-shares.conf] }, because File[/etc/cinder/nfs-shares.conf] doesn't seem to be in the catalog ... and here is the puppet code that results in the above error. Note that the error occurs when the condition `$enabled_backends =~ /netapp-cinder/` evaluates to false. class cinder ( ... long list of parameters ... ) { if ( $enabled_backends =~ /netapp-cinder/ ) { file { '/etc/cinder/nfs-shares.conf': ensure => file, path => '/etc/cinder/nfs-shares.conf', owner => cinder, group => cinder, mode => '0640', content => template('cinder/nfs-shares.conf.erb'), } } # long list of package and file resources package {'qemu-kvm-rhev': ensure => 'present', allow_virtual => false, } -> package { 'openstack-cinder': ensure => 'present', name => 'openstack-cinder', before => [ File['/etc/nova/nova.conf'], ], } -> package { 'python-cinderclient': ensure => 'present', } -> ... even more resource declarations ... service { 'openstack-cinder-api': ensure => running, enable => true, subscribe => [ File['/etc/cinder/cinder.conf'], File['/etc/cinder/nfs-shares.conf'], ], } -> service { 'openstack-cinder-scheduler': ensure => running, enable => true, subscribe => [ File['/etc/cinder/cinder.conf'], File['/etc/cinder/nfs-shares.conf'], ], } -> service { 'openstack-cinder-volume': ensure => running, enable => true, subscribe => [ File['/etc/cinder/cinder.conf'], File['/etc/cinder/nfs-shares.conf'], ], } service { 'openstack-cinder-backup': ensure => running, enable => true, subscribe => [ File['/etc/cinder/cinder.conf'], File['/etc/cinder/nfs-shares.conf'], ], } -> ... more puppet code ... Is there some way I can make the subscribe File['/etc/cinder/nfs-shares.conf'] conditional?

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>