Hi,
I am trying to
exec { myexectest:
path => "/bin:/usr/bin:/usr/sbin",
cwd => "/home/user/.ssh",
command =>"echo test > test.txt",
onlyif => "test -f test.txt"
}
it doesnt work any clues why? I think it cannot change directory to a DOT
directory
please HELP!!
--Nikos Hatzopoulos
--
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/-/KcN7MDyJrZQJ.
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 Tue, Jul 24, 2012 at 05:16:01PM -0700, Nikolaos Hatzopoulos wrote:> Hi, > > I am trying to > exec { myexectest: > path => "/bin:/usr/bin:/usr/sbin", > cwd => "/home/user/.ssh", > command =>"echo test > test.txt", > onlyif => "test -f test.txt"I would have wrapped everything up in a shell script and simply named the shell script as the namevar, but that''s just me.> } > > it doesnt work any clues why? I think it cannot change directory to a DOT > directoryTry running the agent in the foreground with debug on, that will give you a better error message. /etc/init.d/puppet stop; puppet agent --debug --verbose --no-daemonize (There are likely better flags, but I use that out of habit.)> please HELP!! > > --Nikos Hatzopoulos > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > [1]https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ. > 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. > > References > > Visible links > 1. https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ-- 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.
I have set up inventory service to save my client''s fact, as
[master]
facts_terminus = inventory_active_record
dblocation = {sqlite file path (sqlite only)}
dbadapter = {sqlite3|mysql|postgresql|oracle_enhanced}
dbname = {database name (all but sqlite)}
dbuser = {database user (all but sqlite)}
dbpassword = {database password (all but sqlite)}
dbserver = {database server (MySQL and PostgreSQL only)}
dbsocket = {database socket file (MySQL only; optional)}
the question is if I then config the stored config, will the db conflicts?
storeconfigs = true
dbadapter = mysql
dbuser = puppet
dbpassword = password
dbserver = localhost
dbsocket = /var/run/mysqld/mysqld.sock
as many are overlaped, such as dbadapter, dbpassword? I also do not
understand what stored config store other than facts.
Thankls.
Hai T.
--
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.
no it is working I made a mistake I kind of confused with test command for: test -e /folder/file does not work on my centos box it needs cwd to the folder --Nikos On Wednesday, July 25, 2012 9:07:49 AM UTC-7, Christopher Wood wrote:> > On Tue, Jul 24, 2012 at 05:16:01PM -0700, Nikolaos Hatzopoulos wrote: > > Hi, > > > > I am trying to > > exec { myexectest: > > path => "/bin:/usr/bin:/usr/sbin", > > cwd => "/home/user/.ssh", > > command =>"echo test > test.txt", > > onlyif => "test -f test.txt" > > I would have wrapped everything up in a shell script and simply named the > shell script as the namevar, but that''s just me. > > > } > > > > it doesnt work any clues why? I think it cannot change directory to a > DOT > > directory > > Try running the agent in the foreground with debug on, that will give you > a better error message. > > /etc/init.d/puppet stop; puppet agent --debug --verbose --no-daemonize > > (There are likely better flags, but I use that out of habit.) > > > please HELP!! > > > > --Nikos Hatzopoulos > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Puppet Users" group. > > To view this discussion on the web visit > > [1]https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ. > > 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. > > > > References > > > > Visible links > > 1. https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ >-- 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/-/nhcj4iPrVO0J. 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.
this is working:
exec { myexectest:
path => "/bin:/usr/bin:/usr/sbin",
cwd => "/home/user/.ssh",
command =>"echo test > test.txt",
unless => "test -e test.txt"
}
the idea was if a file does not exist just execute something I don''t if
there is a better way of doing that
--Nikos
On Wednesday, July 25, 2012 9:07:49 AM UTC-7, Christopher Wood
wrote:>
> On Tue, Jul 24, 2012 at 05:16:01PM -0700, Nikolaos Hatzopoulos wrote:
> > Hi,
> >
> > I am trying to
> > exec { myexectest:
> > path => "/bin:/usr/bin:/usr/sbin",
> > cwd => "/home/user/.ssh",
> > command =>"echo test > test.txt",
> > onlyif => "test -f test.txt"
>
> I would have wrapped everything up in a shell script and simply named the
> shell script as the namevar, but that''s just me.
>
> > }
> >
> > it doesnt work any clues why? I think it cannot change directory to
a
> DOT
> > directory
>
> Try running the agent in the foreground with debug on, that will give you
> a better error message.
>
> /etc/init.d/puppet stop; puppet agent --debug --verbose --no-daemonize
>
> (There are likely better flags, but I use that out of habit.)
>
> > please HELP!!
> >
> > --Nikos Hatzopoulos
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "Puppet Users" group.
> > To view this discussion on the web visit
> > [1]https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ.
> > 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.
> >
> > References
> >
> > Visible links
> > 1. https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ
>
--
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/-/AhkFwrLhMY4J.
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.
Check out the "creates" meta parameter. http://docs.puppetlabs.com/references/latest/type.html#exec Den On 26/07/2012, at 2:58, Nikolaos Hatzopoulos <nhatzop@gmail.com> wrote:> this is working: > > exec { myexectest: > path => "/bin:/usr/bin:/usr/sbin", > cwd => "/home/user/.ssh", > command =>"echo test > test.txt", > unless => "test -e test.txt" > > } > > the idea was if a file does not exist just execute something I don''t if there is a better way of doing that > > --Nikos > > On Wednesday, July 25, 2012 9:07:49 AM UTC-7, Christopher Wood wrote: > On Tue, Jul 24, 2012 at 05:16:01PM -0700, Nikolaos Hatzopoulos wrote: > > Hi, > > > > I am trying to > > exec { myexectest: > > path => "/bin:/usr/bin:/usr/sbin", > > cwd => "/home/user/.ssh", > > command =>"echo test > test.txt", > > onlyif => "test -f test.txt" > > I would have wrapped everything up in a shell script and simply named the shell script as the namevar, but that''s just me. > > > } > > > > it doesnt work any clues why? I think it cannot change directory to a DOT > > directory > > Try running the agent in the foreground with debug on, that will give you a better error message. > > /etc/init.d/puppet stop; puppet agent --debug --verbose --no-daemonize > > (There are likely better flags, but I use that out of habit.) > > > please HELP!! > > > > --Nikos Hatzopoulos > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To view this discussion on the web visit > > [1]https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ. > > 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. > > > > References > > > > Visible links > > 1. https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ > -- > 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/-/AhkFwrLhMY4J. > 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.-- 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.
Yeap that works also
exec { myexectest:
path => "/bin:/usr/bin:/usr/sbin",
cwd => "/home/user/.ssh",
creates => "/home/user/.ssh/test.txt"
command =>"echo test > test.txt",
}
it needs the absolute path on creates
--Nikos
On Wed, Jul 25, 2012 at 1:53 PM, Denmat <tu2bgone@gmail.com> wrote:
> Check out the "creates" meta parameter.
>
> http://docs.puppetlabs.com/references/latest/type.html#exec
>
> Den
>
> On 26/07/2012, at 2:58, Nikolaos Hatzopoulos <nhatzop@gmail.com>
wrote:
>
> this is working:
>
> exec { myexectest:
> path => "/bin:/usr/bin:/usr/sbin",
> cwd => "/home/user/.ssh",
> command =>"echo test > test.txt",
> unless => "test -e test.txt"
>
> }
>
> the idea was if a file does not exist just execute something I
don''t if
> there is a better way of doing that
>
> --Nikos
>
> On Wednesday, July 25, 2012 9:07:49 AM UTC-7, Christopher Wood wrote:
>>
>> On Tue, Jul 24, 2012 at 05:16:01PM -0700, Nikolaos Hatzopoulos wrote:
>> > Hi,
>> >
>> > I am trying to
>> > exec { myexectest:
>> > path => "/bin:/usr/bin:/usr/sbin",
>> > cwd => "/home/user/.ssh",
>> > command =>"echo test > test.txt",
>> > onlyif => "test -f test.txt"
>>
>> I would have wrapped everything up in a shell script and simply named
the
>> shell script as the namevar, but that''s just me.
>>
>> > }
>> >
>> > it doesnt work any clues why? I think it cannot change
directory to
>> a DOT
>> > directory
>>
>> Try running the agent in the foreground with debug on, that will give
you
>> a better error message.
>>
>> /etc/init.d/puppet stop; puppet agent --debug --verbose --no-daemonize
>>
>> (There are likely better flags, but I use that out of habit.)
>>
>> > please HELP!!
>> >
>> > --Nikos Hatzopoulos
>> >
>> > --
>> > You received this message because you are subscribed to the
Google
>> Groups
>> > "Puppet Users" group.
>> > To view this discussion on the web visit
>> >
[1]https://groups.google.com/**d/msg/puppet-users/-/**KcN7MDyJrZQJ<https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ>.
>>
>> > 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>.
>>
>> >
>> > References
>> >
>> > Visible links
>> > 1.
https://groups.google.com/d/**msg/puppet-users/-/**KcN7MDyJrZQJ<https://groups.google.com/d/msg/puppet-users/-/KcN7MDyJrZQJ>
>>
> --
> 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/-/AhkFwrLhMY4J.
> 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.
>
> --
> 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.
>
--
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.
> > exec { myexectest: > path => "/bin:/usr/bin:/usr/sbin", > cwd => "/home/user/.ssh", > creates => "/home/user/.ssh/test.txt" > command =>"echo test > test.txt", > } > <http://docs.puppetlabs.com/references/latest/type.html#exec>> http://docs.puppetlabs.com/references/latest/type.html#execDo you have provider set in some default Exec -block? If not, then the default is posix, not shell, which probably doesn''t handle stream redirection. Cheers, Paul -- 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/-/r3iLc56hE58J. 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.