search for: append_if_no_such_lin

Displaying 15 results from an estimated 15 matches for "append_if_no_such_lin".

Did you mean: append_if_no_such_line
2007 Aug 20
1
SimpleTextRecipes
I have copied the simple text snippets into a pp file and set a host to attempt to add lines, but regardless if the line is there or not, it still adds it... what am I doing wrong? in definitions/linetests.pp: define append_if_no_such_line($file, $line) { exec { "echo ''$line'' >> ''$file''": unless => "grep -qe ''$line'' -- file", path => "/bin:/usr/bin:/usr/local/bin", } } define prepend_if_no_...
2010 Mar 24
1
problems with project property of User resource
...d the project by adding a line to /etc/ project. The user is created in virtual::user class wich is inherited by the target class to be able to add the project property. The project of the user xxxx gets not set properly and remains default when I use the project property ! Had to fall back to an Append_if_no_such_line solution. I did the following: class xxxxxx inherits virtual::user { . . . append_if_no_such_line { "XXXX-Server-Project": file => "/etc/project", line => "projectname:9998:XXXX Server Project:xxxx:xxxx:process.max-file-descriptor=(priv,40960,de...
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 '...
2007 Jan 14
0
file_splice Hack
...ECTION", $comment_char = "#", $content = "", $input_file = "", $checksum = md5) { case $checksum { "none": {} default: { file { $file: checksum => $checksum } } } # the splice command needs at least the BEGIN line in the file append_if_no_such_line { "seed-$file-$pattern": file => $file, line => "$comment_char BEGIN $pattern", require => File [ $file ], } case $content { "": { case $input_file { "": { fail ("either input_f...
2011 Apr 12
1
any better way to manage access control via /etc/passwd
We need to manage /etc/passwd where there would be one line at the very end of the file to restrict access to all users not explictly allowed: +::::::/sbin/nologin If using delete_lines and append_if_no_such_lines (similar to this one at http://www.debian-administration.org/articles/528) to manage access control, each time a few new users got appended to /etc/passwd file, the above line would be deleted and appended, for many times, while it only needs to be done once. Any better way to manage this file i...
2010 Mar 22
3
custom type/provider load error
...ib/puppet/lib/puppet/provider/sysctl/parsed.rb]/ensure: content changed ''{md5}6814a933459673af15383e4445ecdc57'' to ''{md5}6814a933459673af15383e4445ecdc57'' notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created notice: /File[/var/lib/puppet/lib/puppet/type/append_if_no_such_line.rb]/ensure: content changed ''{md5}463a51cc5e538dbe658af9041191949d'' to ''{md5}463a51cc5e538dbe658af9041191949d'' notice: /File[/var/lib/puppet/lib/puppet/type/groupmembers.rb]/ensure: content changed ''{md5}f8cf9fb977776071078252a35c1807d2'' to ...
2011 Jun 17
5
ssh_authorized_key and NIS user
...e[idmapd]) Triggered ''refresh'' from 1 events Jun 17 14:15:41 node016 puppet-agent[1109]: (/Stage[main]/All/File[/etc/yp.conf]/ensure) defined content as ''{md5}9c23d37f431c0788c212d3c0ab8a48af'' Jun 17 14:15:58 node016 puppet-agent[1109]: (/Stage[main]/All/All::Append_if_no_such_line[sudoers_nagios_smartctl]/Exec[/bin/echo ''nagios ALL=(root) NOPASSWD: /usr/sbin/smartctl'' >> ''/etc/sudoers'']/returns) executed su ccessfully Jun 17 14:17:03 node016 puppet-agent[1109]: (/Stage[main]//Package[nis]/ensure) ensure changed ''purged...
2007 Jan 09
3
Can i manage part of a file ..
Can I use puppet to ensure that a file includes certain text but not be required to maintain the entire file? For example, I would like /etc/modprobe.conf to contain the following lines but the file will also contain lines that are system dependent. --------------------------------------------------------------------------------------- # Disable IPV6 alias net-pf-10 off alias ipv6 off
2007 Jan 17
16
Cron jobs not removed when deleted from Manifest
I''m not sure if this has been posted previously, but I couldn''t find any information on it. I added a cron job via the cron type and it installed properly. Next, I removed the cron type from the manifest. The result was that, while the entry was no longer in the yaml file, the cron entry was not removed! Is this a bug, or the way that it is supposed to function? Thank you,
2007 Jun 20
1
How to handle package conflicts between classes ..
...s": descr => "Fedora Directory Server repo", repopath => "/$operatingsystem/fedora-ds/\$releasever/\$basearch/", gpgcheck => 0, enabled => 1 } append_if_no_such_line { "sysctl-keepalive": file => "/etc/sysctl.conf", line => "net.ipv4.tcp_keepalive_time = 300"; "sysctl-port-range": file => "/etc/sysctl.conf"...
2007 Aug 23
24
Type development for the rest of us
Since I had my type development epiphany a couple of days ago, I''ve decided to write down my understanding of developing simple types, at http://reductivelabs.com/trac/puppet/wiki/PracticalTypes. I''d appreciate comments from people who already know how to develop types as to correctness, and also comments from people who are new to type development about whether it''s a
2007 Sep 30
3
managing FreeBSD services
Hi, I''d like to hear opinions from FreeBSD users. I''ve wrote a freebsd service provider, which is available as Ticket #837. http://reductivelabs.com/trac/puppet/ticket/837 This hack extends init service provider, by adding enable method. With freebsd.rb, you can enable services like other service providers do. service { foo: ensure => running, enable => true, ...
2006 Nov 16
7
Negating or removing classes
...9;' case tagged("sshkey_service"){ false: { replace_line { rmkey: file => ''authorized_keys", search => $key, replace => "" } <other stuff related to the service> } } class sshkey_service { append_if_no_such_line { mkkey: file => "authorized_keys", line => $key, require => File["authorized_keys"] } <other stuff related to the service > } node mr_no_service { } node mr_service { include sshkey_service } (The components are from the cookbook.)...
2007 Apr 09
11
Issues with Puppet on FreeBSD / Creating a Recipe
Hi, I am running an environment with 15 FreeBSD servers on which I want to maintain ports, rc.conf settings, and assorted configuration in /usr/local/etc/. Looked around the existing Puppet docs, I got a puppetmaster and a test client to work and install a package as specified in the site manifest. This is very basic but awesome! I want to create a puppet FreeBSD HowTo that addresses a
2007 Jan 23
20
"Found a bug" message when purging services
I attempted the following: resources { service: purge => true, noop => true } service { sshd: ensure => running; iptables ensure => running; } And got the following message: notice: Starting configuration run err: Found a bug: uninitialized constant Parse notice: Finished configuration run in 0.47 seconds When I remove the ''resources'' line, everything works