file vs File and changing several lines in a exclude file
When I run this, it works on those directories that exist, but fails dependency on missing directories.
Notice: /Stage[main]/Profile::Baseline::Tsm_oracle_audit_exclude/Exec[Recycle TSM]: Dependency File[/app/grid/product/11.2.0.3/rdbms/audit] has failures: true
Warning: /Stage[main]/Profile::Baseline::Tsm_oracle_audit_exclude/Exec[Recycle TSM]: Skipping because of failed dependencies
If I run a second time I get even more failed messages?
class profile::baseline::tsm_oracle_audit_exclude {
case $::osfamily {
/AIX/: { $iepath = '/usr/tivoli/tsm/client/ba/bin64/dsm.inclexcl.opt' }
default: { $iepath = '/opt/tivoli/tsm/client/ba/bin/dsm.inclexcl.opt' }
}
file { $iepath :
ensure => present,
}
$check_dirs = [
'/opt/oracle/diag/asm',
'/opt/oracle/diag/rdbms',
'/app/oracle/diag/asm',
]
file { $check_dirs:
ensure => present,
}
file_line { '/opt/oracle/diag/asm' :
path => $iepath,
line => 'exclude /opt/oracle/product/diag/.../*.aud',
require => [ File['/opt/oracle/diag/asm'], File['/opt/oracle/diag/rdbms'] ],
notify => Exec['Recycle TSM'],
}
file_line { '/app/oracle/product/diag':
path => $iepath,
line => 'exclude /app/oracle/product/diag/.../*.aud',
require => File['/app/oracle/product/diag'],
notify => Exec['Recycle TSM'],
}
exec { 'Recycle TSM':
command => '/etc/init.d/dsmmgr stop; /etc/init.d/dsmmgr start ',
timeout => 0,
subscribe => File[$iepath],
provider => shell,
refreshonly => true,
}
}
`File` can only reference things that exist in your catalog.. it can not be used to find actual directories on your system. `file` is how you declare resources. I'm not 100% sure exactly what you are asking.
I want to add lines to a configuration file ( ie an exclude list for backup) if a directory exists