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}")
} }
}
↧