Re: [Puppet Users] resource file with option source or content depending if source does exist

2014-10-20 Thread Andreas Dvorak
Hi,

no I habe a puppet master.

Best regards,
Andreas

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b02f382f-2fd8-415a-9ffd-0e8413a8e427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] resource file with option source or content depending if source does exist

2014-10-20 Thread Felix Frank
On 10/17/2014 03:05 PM, Andreas Dvorak wrote:
> If I try this
>  $a = file("puppet:///motd_files/motd/motd-${::hostname}",'/dev/null')
> I get the error that Files must be fully qualified
> 
> Does anybody has a solution for that?

Hi,

so are you running masterless?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5444ECF9.804%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] resource file with option source or content depending if source does exist

2014-10-17 Thread Andreas Dvorak
Dear all,

I would like to use the file resource to supply a host specific file. If it 
does exist choose it and if not create a file from a template.
I tried this, but then /mnt/motd needs to be on all server.

  $a = file("/mnt/motd/motd-${::hostname}",'/dev/null')
  if($a != '') {
file {$config_file:
  ensure => 'file',
  owner  => 'root',
  group  => 'root',
  mode   => '0644',
  source => "puppet:///motd_files/motd/motd-${::hostname}",
}
  }
  else {
file { $config_file:
  ensure  => 'file',
  owner   => 'root',
  group   => 'root',
  mode=> '0644',
  content => template($template),
}
  }

If I try this 
 $a = file("puppet:///motd_files/motd/motd-${::hostname}",'/dev/null')
I get the error that Files must be fully qualified

Does anybody has a solution for that?

Best regards
Andreas

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bb44ef68-dcda-4c35-9e47-58008e88480a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.