Displaying 20 results from an estimated 120 matches for "onlyif".
2011 May 02
2
exec resource: negate onlyif condition
Hi,
today I''m stupid. How can I negate the test for execs onlyif?
I want to run the exec onlyif command returns 1.
regards, Andreas
--
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 puppe...
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 command,
if a web page doesn''t currently exist on the server (i.e. the PowerShell
script is responsible for deploy...
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...
2012 Aug 29
1
augeas and cron.allow
...etting it to add the name once.
augeas { "check_mk_cron.allow" :
context => "/files/etc/cron.allow",
# changes => "set line[last()+1] $name",
changes => "set 1[last()+1] $name",
# onlyif => "match /files/etc/cron.allow/* include ALL",
onlyif => "match *[.=''$name''] not_include $name",
# onlyif => "get 1[.=''ALL''] == ALL",
}
The line '' changes => "set...
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 {
'''': { err ( "Require valid target directory:
''$target''&qu...
2008 Oct 08
10
Puppet Augeas Plugin
...t;sysctl_conf"],
}
}
define sysctl::config ($ensure) {
augeas { "sysctl_conf_$name":
notify => Exec["sysctl"],
context => "/files/etc/sysctl.conf",
changes => "set $name $ensure",
onlyif => "get $name != $ensure"
}
}
poking around in augeas.rb I noticed that "onlyif" is only processed if
the result is not nil. Is this intended behavior? I propose that if
the return value is nil it should be treated as an empty string so
comparisons can still h...
2013 Nov 06
4
augeas onlyif problem
...t;:
context => "/files/home/user/.ssh/config",
changes => [ "ins IdentityFile after
/files/home/user/.ssh/config/IdentityFile[last()]",
" set /files/home/user/.ssh/config/IdentityFile[last()]
~/.ssh/user2nd_rsa",
],
onlyif => "match /files/home/user/.ssh/config/IdentityFile not_include
~/.ssh/user2nd_rsa",
}
However it adds the line every puppet run. I''m wondering what I might be
doing wrong.
--
You received this message because you are subscribed to the Google Groups "Puppet...
2011 Apr 21
6
ssh_authorized_key fails when home directory doesn't exist
..."billys key":
ensure => present,
key => ''billys sshkey'',
name => "super duper key",
type => ssh-rsa,
user =>"billy",
onlyif => "test -d /home/${user}"
}
I am assuming that I can refer to the user with ${user} and that onlyif is a valid parameter.
Is this possible?
Corey
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To...
2009 Mar 02
31
Using Augeas type to update sshd_config's AllowGroups
...share/augeas/lenses/sshd.aug:20.7-.37:Short split for concat
err:
//Node[testnode]/ssh/Ssh::Sshd_conf_group[sshuser]/Augeas[sshd_conf_group_sshuser]/returns:
change from need_to_run to 0 failed: Save failed with return code false
notice: Finished catalog run in 9.46 seconds
I also want to add an onlyif to that type so that it only adds the
sshuser group if it doesn''t already exist, but none of these seem to work:
onlyif => "match /files/etc/ssh/sshd_config/AllowGroups/* != sshuser"
onlyif => "match /files/etc/ssh/sshd_config/AllowGroups/ != sshuser"
onlyif =&g...
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@goog...
2010 Jun 30
7
augeas and sudo woes
The following function is based on code I found here in an earlier
thread.
define sudoer() {
augeas { "sudo${name}":
context => "/files/etc/sudoers",
changes => [
"set spec[last() + 1]/user ${name}",
"set spec[last()]/host_group/host ALL",
"set spec[last()]/host_group/command NOPASSWD: ALL",
"set
2010 Feb 18
7
Augeas pam.d argument checking
I''m trying to change the password complexity requirements in
pam.d/system-auth using augeas. I can append the values (lcredit=-1,
ucredit=-1, etc) onto the correct place, but if another value is
already present (i.e. lcredit=-2), the onlyif match statement doesn''t
seem to support checking regular expressions inside of strings. How do
I check that any numeric value exists in the argument??
define passwordcomplexity($lowercase = "1", $uppercase = "1",
$numeric = "1", $special = "1&quo...
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 /etc/pki/tls/certs/ca-bundle.crt'' is
> both unqu
> alifed and specifie...
2007 Mar 29
2
some questions regarding inhert, unless/onlyif and notify on recursive objects
...> "/tmp",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "if test ! -f /var/lib/aide/aide.db.new ;
then /usr/bin/aide.wrapper --init; fi",
creates => "/var/lib/aide/aide.db.new",
onlyif => "test ! -f /var/lib/aide/aide.db.new",
subscribe => Exec["update-aide.conf"],
notify =>
Exec["cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db"],
}
exec { "cp /var/lib/aide/aide.db.new /var/lib/aide/ai...
2010 Dec 23
2
Multiple AllowGroups entries in sshd_config with Puppet and Augeas
...}":
context => "/files/etc/ssh/sshd_config",
require => File["/etc/ssh/sshd_config"],
notify => Service["sshd"],
changes => "set AllowGroups/*[last()+1] ${name}",
onlyif => " match AllowGroups/*[.=''${name}''] size == 0";
}
}
}
Then on a node, I can use this:
node "webserver" {
ssh::server::config::addallowgroup { ["test1", "test2", "test3"]: }
}
Sadly, the "changes" a...
2009 Oct 26
17
Relation to DMTF's CIM
I was wondering how Puppet relates to the DMTF''s CIM. AFAICT there is
a clear connection between the two, but I see very little discussion
on the topic on the list.
Thanks,
Cameron.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to
2010 Dec 29
1
Puppet and augeas - onlyif conditions; overwriting default values
...quot;:
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.aio-max-nr 1048576",
"set fs.file-max 9000",
],
notify => Exec["load-sysctl"],
onlyif => "match #comment[1] != ''MODIFY_FLAG''",
}
exec { "load-sysctl":
command => "/sbin/sysctl -p",
refreshonly => true,
}
...
####################################################
2. custom puppet module to adjust adjus...
2012 Jul 31
4
Long processing time using Augeas
...''set *[file =
"/home"]/dump 0'',
''set *[file =
"/home"]/passno 0'',
],
onlyif => ''match *[file =
"/home"] size > 0'',
}
augeas { ''optLV'':
context =>
''/files/etc/fstab'',...
2008 Jul 30
6
Refreshonly question
Does anyone have a technique for performing an exec the first time
puppetd runs but then reverting to refreshonly => true state for
subsequent runs?
The basic idea is:
file { "/etc/foo":
notify => Exec["bar"]
}
exec { "bar":
command => "Do stuff to /etc/foo",
refreshonly => true
}
Should I use a fact that is unset based on a
2010 Aug 31
2
Executing check times out
...9;test \! -d /
dir''
debug: Executing ''test \! -d /dir''
[...]
Here it hangs for several minutes, executin the statement manually
works of course.
The manifest:
exec { "create dir":
command => "mkdir -p /dir",
onlyif => "test \! -d /dir",
}
What am I missing?
--
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-u...