I have this in my /manifests/site.pp Do i need to send you more files? I don''t think so... class sudo { file { "/tmp/prueba.txt": owner => root, group => root, mode => 440, ensure => present, content => "esto es una prueba", source => "puppet://groening.dibujos.local/files/etc/ prueba.txt" } } node default { include sudo } I only want for test is that i can create a file named prueba.txt in tmp. I saw some more examples, but they are obsoletes. For example, i added source too... And friends said me that i must use the content => "something" too... How do i create a simple file? Thanks. Jorge. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, On 03/25/2011 11:46 AM, tigreton wrote:> I have this in my /manifests/site.pp > Do i need to send you more files? I don''t think so... > class sudo { > file { "/tmp/prueba.txt": > owner => root, > group => root, > mode => 440, > ensure => present, > content => "esto es una prueba", > source => "puppet://groening.dibujos.local/files/etc/ > prueba.txt" > } > } > node default { > include sudo > } > > > I only want for test is that i can create a file named prueba.txt in > tmp. I saw some more examples, but they are obsoletes. > For example, i added source too... And friends said me that i must use > the content => "something" too... > How do i create a simple file? Thanks. Jorge.you''ve been given confusing information. "source" and "content" are mutually exclusive. Use either source or content. If you only need to make sure the file is there and has the given owner/mode, don''t use content nor source. HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ahm okok. I want to create a file. So i will use content. Thanks On 28 mar, 09:10, Felix Frank <felix.fr...@alumni.tu-berlin.de> wrote:> Hi, > > On 03/25/2011 11:46 AM, tigreton wrote: > > > > > > > > > > > I have this in my /manifests/site.pp > > Do i need to send you more files? I don''t think so... > > class sudo { > > file { "/tmp/prueba.txt": > > owner => root, > > group => root, > > mode => 440, > > ensure => present, > > content => "esto es una prueba", > > source => "puppet://groening.dibujos.local/files/etc/ > > prueba.txt" > > } > > } > > node default { > > include sudo > > } > > > I only want for test is that i can create a file named prueba.txt in > > tmp. I saw some more examples, but they are obsoletes. > > For example, i added source too... And friends said me that i must use > > the content => "something" too... > > How do i create a simple file? Thanks. Jorge. > > you''ve been given confusing information. > > "source" and "content" are mutually exclusive. Use either source or > content. If you only need to make sure the file is there and has the > given owner/mode, don''t use content nor source. > > HTH, > Felix-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 03/28/2011 05:04 PM, tigreton wrote:> Ahm okok. I want to create a file. So i will use content. Thanks >> you''ve been given confusing information.Reviewing my response, I should have elaborated a bit myself. If you specify content, be aware that puppet will overwrite whatever you put into the file with what you specify here. On the other hand, if you use source, puppet will overwrite the file with what it finds at the locations specified as source (a URL like puppet:///path/to/file/on/master or file://path/to/file/on/client). If you don''t want puppet to change the contents of the file, but do create the file if it is not there, you must not use content nor source. I hope that makes it more clear. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Thanks for your time Felix. I''m not clear hehe. So if i want to create a file and i musn''t use content nor source, what i must use? Thanks. On 28 mar, 17:14, Felix Frank <felix.fr...@alumni.tu-berlin.de> wrote:> On 03/28/2011 05:04 PM, tigreton wrote: > > > Ahm okok. I want to create a file. So i will use content. Thanks > >> you''ve been given confusing information. > > Reviewing my response, I should have elaborated a bit myself. > > If you specify content, be aware that puppet will overwrite whatever you > put into the file with what you specify here. > > On the other hand, if you use source, puppet will overwrite the file > with what it finds at the locations specified as source (a URL like > puppet:///path/to/file/on/master or file://path/to/file/on/client). > > If you don''t want puppet to change the contents of the file, but do > create the file if it is not there, you must not use content nor source. > > I hope that makes it more clear. > > Cheers, > Felix-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi, On 03/29/2011 03:27 PM, tigreton wrote:> Thanks for your time Felix. I''m not clear hehe. > So if i want to create a file and i musn''t use content nor source, > what i must use? Thanks.if you want puppet to make sure the file exists, but not care about its content, use file { "/tmp/foo": ensure => present } You can also specify owner etc. file { "/tmp/foo": ensure => present, mode => 644, owner => "felix", } If you do specify the content parameter, puppet *will* make sure that your file never has any other content (the same is true for the source parameter). HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
So if i use content, and the file doesn''t exist, the puppetmaster *will* create it? On 29 mar, 15:31, Felix Frank <felix.fr...@alumni.tu-berlin.de> wrote:> Hi, > > On 03/29/2011 03:27 PM, tigreton wrote: > > > Thanks for your time Felix. I''m not clear hehe. > > So if i want to create a file and i musn''t use content nor source, > > what i must use? Thanks. > > if you want puppet to make sure the file exists, but not care about its > content, use > > file { "/tmp/foo": > ensure => present > > } > > You can also specify owner etc. > > file { "/tmp/foo": > ensure => present, > mode => 644, > owner => "felix", > > } > > If you do specify the content parameter, puppet *will* make sure that > your file never has any other content (the same is true for the source > parameter). > > HTH, > Felix-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 03/30/2011 05:05 PM, tigreton wrote:> So if i use content, and the file doesn''t exist, the puppetmaster > *will* create it?Yes. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.