Displaying 20 results from an estimated 10000 matches similar to: "exec resource: negate onlyif condition"
2013 Apr 15
5
Using onlyif for Windows exec
Hello,
I am in the process of "trying out" Puppet, and so far, it is going really
well, and I can see a clear line of how we can use it internally.
I do have one question though with regard to the using the onlyif parameter
of the exec command (as per here
http://docs.puppetlabs.com/references/latest/type.html#exec).
Ideally, what I would like to do is to only run a PowerShell exec
2012 Apr 25
5
exec's onlyif parameter fails for a bash one-liner
I would like to ''exec'' an installation script ''onlyif'' an installation
directory is empty. I tried using following bash one-liner however it
didn''t work:
<code>
exec{$one_install_script:
require => File[$one_install_script],
onlyif => "[ \"$(/bin/ls -A $one_location)\" ] && exit 1 || exit
0"
}
2009 Dec 17
1
unless & onlyif for the exec
Hello,
Can I specify multiple onlyif''s and/or unless''s in an exec statement?
A quick look through the recipes didn''t find any...
Thanks,
-Roy
--
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
2012 Jul 03
6
Using onlyif
Here''s what I''m using:
exec { "cert-fix":
command => "curl http://curl.haxx.se/ca/cacert.pem -o
/etc/pki/tls/certs/ca-bundle.crt",
onlyif => "test -e /etc/pki/tls/certs/ca-bundle.crt",
}
But it keeps on failing:
> [default] Running Puppet with /tmp/vagrant-puppet/manifests/acid.pp...
> Parameter onlyif failed: ''test -e
2012 Mar 12
10
Use onlyif in EXEC
Hi guys!
I need configure one command exec with onlyif parameter.
I want test file size exist or no.
Ho i do this?
Tks in advanced.
Douglas
--
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
2013 Nov 06
4
augeas onlyif problem
I''m trying to make sure a specific user has a special ssh key used as his
identity file.
so I''m trying something like:
augeas{"user_second_key":
context => "/files/home/user/.ssh/config",
changes => [ "ins IdentityFile after
/files/home/user/.ssh/config/IdentityFile[last()]",
" set
2011 Jun 30
4
using memorysize fact in manifests
Hi,
I want some config depending on memorysize.
What I tried was
if ($memorysize >= 256 * 1024*1024) {
...
}
But this fails because $memorysize is a string (and contains a "G") and can''t be
compared to an int.
Are all facts strings? How do I work with numbers?
regards, Andreas
--
Andreas Kuntzagk
SystemAdministrator
MDC Berlin / BIMSB
Tel.: +49 30 9406 2997
--
2007 Feb 06
14
Unless in exec doesn''t seem to be honored on notify.
This was a fun one to track down...
I was trying to use the append_if_no_such_line script from the wiki and it
was working fine EXCEPT when I threw a notify at it.
The notify appears to completely ignore both unless and onlyif within the
exec for some reason.
If I put the same test in the actual command line, it works fine.
Example:
unless => "/bin/grep -Fqe ''$line''
2011 Feb 08
6
Unrecognised escape sequences
unfortunately, we keep getting this warns into the system log by
puppet masters:
" [...] Unrecognised escape sequence ''\<CHAR>'' in file <PATH> [...] "
but then everything works fine; also, without using escapes, catalogs
dont work on agents.
What can we do to avoid these kind of errors in master syslogs?
Please ,let us know ASAP and tell us if this
2007 Jan 15
7
How to conditionally run defines?
Hi all,
Is there a (simple) way to add conditionals to a call to a define?
What I want is to run a define only if a file (that gets created
somewhere along the run of the define) does not exist. In this way I
can skip a whole lot of setup work in the define if I know it has
already run once before. I would think adding a unless clause would be
a elegant solution (and the other conditionals like
2007 Jan 15
1
Re: How to conditionally run defines? (and a question about updating... )
OK, too bad. I could work around it of course by adding ''unless'' and
''creates'' clauses on all the individual parts of the define where
appropriate, but I think I''ll just ignore the warnings and overhead for now.
It would be cool, though, if something like the ''unless'', ''onlyif'', etc,
logic was available for all
2011 Apr 21
6
ssh_authorized_key fails when home directory doesn't exist
Here is my situation:
1. We use Active directory (LDAP) to store all user info which is retrieved from linux
2. A home directory is not created until the first time the user logs into the linux system
I am using the ssh_authorized_key type to push out my ssh keys to every system. However, because I haven''t logged into every system at least once. Puppet errors out due to a missing
2010 Dec 29
1
Puppet and augeas - onlyif conditions; overwriting default values
Hello,
I am still not getting warm with augeas and puppet, there are some
things I do not understand. At the moment I am trying the following:
- I want to set some kernel parameters in the /etc/sysctl.conf file
- in one puppet module, I have defined some default values for the
kernel parameters
- but for several servers I want to modify some of these values,
therefore I would like to overwrite
2011 May 13
5
puppet resource for group
Hi,
Why doesn''t puppet resource group tell me who belongs to the group?
Given the group such as:
mg_team:x:501:smruph, cosman, msmith, mhankey
With the command:
puppet resource group mg_team
only returns:
group { ''mg_team'':
gid => ''501'',
ensure => ''present''
}
I was expecting:
group { ''mg_team'':
2011 Jun 17
5
ssh_authorized_key and NIS user
Hi,
I have this resource definition:
ssh_authorized_key { "nagios@login2":
key => [REDACTED]
user => "nagios",
type => "ssh-dss",
require => Service[''nis''],
}
This nagios user comes from NIS, yp.conf and nsswitch.conf are handled by puppet
and configured before the key. I still get an "User does not
2011 Nov 01
12
What's the canonical way to enforce permissions/ownership on a directory subtree?
I''ve just tried this (we assume /opt/jetty-6.1.26 already exists):
file { "/opt/jetty-6.1.26":
owner => "jetty",
group => "users",
recurse => true,
}
... but it''s taking an *age*. What''s the Right Way?
Cheers, Robert.
--
You received this message because you are subscribed to the Google Groups
2007 Mar 18
1
A wish or possible?
Hi,
One thing I''d like to be able to do is this...
define sedfile ( $file = '''', $target = '''', $pattern = '''', $options = ''-i -n''
, onlyif = '''' ) {
case $file {
'''': { err ( "Require valid filename: ''$file''" ) }
}
case $target {
2013 Apr 19
12
How to pass puppet/hiera veriable to external script ? Do I need to ?
Hi,
I have a problem with running puppet with hiera based data. I am trying to
cleanup
user accounts on a range of servers (to have the same uid/gid). When I
create existing account
but with different uid/gid it doesn''t change files group ownership so I
need to
run a script which cleanups after cleanup ;-)
I use the following code:
---
:backends:
- yaml
:hierarchy:
-
2012 Aug 29
1
augeas and cron.allow
Hi.
I am having a few problems with augeas and need some help.
What I am trying to use is augeas to update the cron.allow file. I can get augeas to add the required name but I am having problems with getting it to add the name once.
augeas { "check_mk_cron.allow" :
context => "/files/etc/cron.allow",
# changes => "set
2011 Apr 15
15
Installing port on FreeBSD
New user trying to get a port to compile: I tried searching but all I
get are links to the FreeBSD port of puppet. Easier to find a needle
in a haystack.
A class has:
exec { "port-sudo":
cwd => "/usr/ports/security/sudo",
environment => "BATCH=yes",
command => ''/bin/sh -c "/usr/bin/make