Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
file { '/etc/something.cfg':
    ensure => 'present',
    notify => exec['replace_content'],
    replace => no,
    source => 
    }

exec { 'replace_content':
    command => 'use sed command to do the job'
    path => '/usr/local/bin/:/bin/',
    }

This may work, but may not be the puppet way of doing it. Just try it once..!


Best way is to just ensure that file is present..!

file { '/etc/something.cfg':
    ensure => 'present',
    source => 
    mode => '0644',
    }