Nikolaos Hatzopoulos
2012-Jul-30 17:21 UTC
[Puppet Users] exec in master transfer files to the node
How you exec something in the master produce a file and this files you transfer it to your node? --Nikos -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Li655JGrxaMJ. 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.
David Schmitt
2012-Jul-31 07:07 UTC
Re: [Puppet Users] exec in master transfer files to the node
On 30.07.2012 19:21, Nikolaos Hatzopoulos wrote:> How you exec something in the master produce a file and > this files you transfer it to your node?take a look at the template(), inline_template() and generate() function: http://docs.puppetlabs.com/references/stable/function.html Best Regards, David -- 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.
Nikolaos Hatzopoulos
2012-Jul-31 18:09 UTC
Re: [Puppet Users] exec in master transfer files to the node
exec { "sshkeygen":
path => "/usr/bin:/usr/sbin:/bin",
creates => [
"puppet:///myuser/files/$username/id_rsa" ,
"puppet:///myuser/files/$username/id_rsa.pub" ],
command =>
generate("/bin/bash","/etc/puppet/manifests/myusers/sshkeygen.bash"
)
}
this command does not work!! why?
err: Could not retrieve catalog from remote server: wrong header line format
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
--Nikos
On Tue, Jul 31, 2012 at 12:07 AM, David Schmitt <david@dasz.at> wrote:
> On 30.07.2012 19:21, Nikolaos Hatzopoulos wrote:
>
>> How you exec something in the master produce a file and
>> this files you transfer it to your node?
>>
>
> take a look at the template(), inline_template() and generate() function:
>
>
http://docs.puppetlabs.com/**references/stable/function.**html<http://docs.puppetlabs.com/references/stable/function.html>
>
>
> Best Regards, David
>
>
> --
> 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 <puppet-users%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
>
group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>
> .
>
>
--
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.
David Schmitt
2012-Aug-01 07:28 UTC
Re: [Puppet Users] exec in master transfer files to the node
On 31.07.2012 20:09, Nikolaos Hatzopoulos wrote:> exec { "sshkeygen": > path => "/usr/bin:/usr/sbin:/bin", > creates => [ "puppet:///myuser/files/$username/id_rsa" > , "puppet:///myuser/files/$username/id_rsa.pub" ], > command => > generate("/bin/bash","/etc/puppet/manifests/myusers/sshkeygen.bash" ) > } > > > this command does not work!! why? > > err: Could not retrieve catalog from remote server: wrong header line format > warning: Not using cache on failed catalog > err: Could not retrieve catalog; skipping runAt least the following things are wrong/do not work as you seem to expect it: * The generate() function is run on the master while compiling the catalog. * The exec then tries to execute the stdout of the script on the client. * The "creates" parameter avoids running the command when the specified files exist. This only checks local files and not puppet:/// urls. Best Regards, David -- 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.
Nikolaos Hatzopoulos
2012-Aug-07 15:36 UTC
Re: [Puppet Users] exec in master transfer files to the node
I use this inside the class
generate("/bin/bash","/etc/puppet/manifests/myusers/sshkeygen.bash")
and I am generating a key inside the server but the permission of the folder
must be: user: puppet group: puppet
--Nikos
On Wed, Aug 1, 2012 at 12:28 AM, David Schmitt <david@dasz.at> wrote:
> On 31.07.2012 20:09, Nikolaos Hatzopoulos wrote:
>
>> exec { "sshkeygen":
>> path => "/usr/bin:/usr/sbin:/bin",
>> creates => [
"puppet:///myuser/files/$**username/id_rsa"
>> , "puppet:///myuser/files/$**username/id_rsa.pub" ],
>> command =>
>>
generate("/bin/bash","/etc/**puppet/manifests/myusers/**sshkeygen.bash"
)
>> }
>>
>>
>> this command does not work!! why?
>>
>> err: Could not retrieve catalog from remote server: wrong header line
>> format
>> warning: Not using cache on failed catalog
>> err: Could not retrieve catalog; skipping run
>>
>
> At least the following things are wrong/do not work as you seem to expect
> it:
>
> * The generate() function is run on the master while compiling the
> catalog.
> * The exec then tries to execute the stdout of the script on the
> client.
> * The "creates" parameter avoids running the command when the
> specified files exist. This only checks local files and not
> puppet:/// urls.
>
>
> Best Regards, David
>
>
>
> --
> 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 <puppet-users%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
>
group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>
> .
>
>
--
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.