0

My init.pp looks like below:

class checkout {
 file { '/etc/example/test/testcv.sh':
ensure   => present,
owner => 'root',
mode => '0755',
content => template('checkout/testcv.sh.erb')
}
}

What this does is, copies testcv.sh to my /etc/example/test/ in all my hosts automatically. But if I have to copy the directory to the certain location what resource type should I use? I tried replacing file with "dir" but it didn't work.

James
  • 193
  • 2
  • 4
  • 15
  • I think this may be a semi-duplicate of your other question http://stackoverflow.com/questions/36069655/how-to-secure-copy-using-puppet – ptierno Mar 21 '16 at 23:25
  • You are right. I asked both questions. I will delete this. Update: Couldn't delete because it has been answered. – James Mar 22 '16 at 00:42
  • may want to except it as the answer then ;) (assuming it answered your question) – ptierno Mar 22 '16 at 01:19

1 Answers1

1

The file resource is also used to create directories by changing the ensure parameter to directory.

file { '/etc/example/test':
  ensure => directory
  ...
  ...
}
ptierno
  • 9,534
  • 2
  • 23
  • 35