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

How to run "case" portion of the code only after requirement is fullfilled.

$
0
0
Hi, I need to modify code, so that "case" part of the code runs only if "exec" finds "/EFS/customer_data|/EFS/saas_data" in fstab, How can I do that ? exec { 'Ensure EFS is not already used': command => "/bin/egrep -q '/EFS/customer_data|/EFS/saas_data' /etc/fstab", } $already_mounted = Exec['Ensure EFS is not already used'] if $already_mounted =~ /(\/EFS\/customer_data|\/EFS\/saas_data)/ { case $site_type { 'gluster': { gluster::mount { '/ss_data': ... } gluster::mount { '/cust_data': .... } $cdir_require = Gluster::Mount['/cust_data'] $sdir_require = Gluster::Mount['/ss_data'] } 'nfs-aws': { $mstr_dirs = [ '/cust_data', '/ss_data' ] file { $mstr_dirs: ... } mount { '/cust_data': ..... } mount { '/ss_data': ..... } $cdir_require = Mount['/cust_data'] $sdir_require = Mount['/ss_data'] } default: { fail("Unknown site_mount_type. Received ${site_type}") } } }

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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