Edit: The example below is correct and works perfectly. But for some reason it was not working for me at the first time and then I did vagrant provision
and then everything worked perfectly.
I am trying to add a line to an existing file /etc/fuse.conf. I tried this
added a folder two folders under modules directory
sudo mkdir /etc/puppet/modules/test
sudo mkdir /etc/puppet/modules/test/manifests
Then created a test.pp file and added following lines
sudo vim /etc/puppet/modules/test/manifests/test.pp
file { '/etc/fuse.conf':
ensure => present,
}->
file_line { 'Append a line to /etc/fuse.conf':
path => '/etc/fuse.conf',
line => 'Want to add this line as a test',
}
After that I ran this command
puppet apply /etc/puppet/modules/test/manifests/test.pp
Then I opened this file /etc/fuse.conf
and there was no change in the file. The line was not added to the file. I don't understand what I am missing here. How can I do this? I am learning puppet. So this is only for learning purpose.
$modulepath
? Do you have any errors in the console output of thepuppet apply
command?