[Puppet Users] [augeas] ins before / after

2020-07-09 Thread Helmut Schneider
Hi, I want to put values ordered in (here) sshd_config. I tried with ins...after but get only errors: 'sshd_config PrintMotd': context: '/files/etc/ssh/sshd_config' changes: - 'set PrintMotd yes' 'sshd_config PasswordAuthentication': context: '/files/etc/ssh/sshd_config' changes:

[Puppet Users] Augeas and SSH

2019-09-24 Thread Helmut Schneider
Hi, I want to set some values in sshd_config. Example: KexAlgorithms curve25519-sha...@libssh.org,diffie-hellman-group-exchange-sha256 keys($sshdCfg).each |String $comment| { augeas { "$file: $comment": context => $sshdCfg[$comment]['context'], changes => [

Re: [Puppet Users] [augeas] edit YAML file

2019-02-09 Thread Helmut Schneider
Ben Ford wrote: > The https://forge.puppet.com/fiddyspence/hash_file module makes it > very easy to manage yaml files. Will check. Thank you. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving

Re: [Puppet Users] [augeas] edit YAML file

2019-02-07 Thread Ben Ford
The https://forge.puppet.com/fiddyspence/hash_file module makes it very easy to manage yaml files. Sent from my iPhone > On Feb 7, 2019, at 4:47 PM, Helmut Schneider wrote: > > Hi, > > I want to edit a YAML file: > > network: > version: 2 > renderer: networkd > ethernets: >eth0: >

[Puppet Users] [augeas] edit YAML file

2019-02-07 Thread Helmut Schneider
Hi, I want to edit a YAML file: network: version: 2 renderer: networkd ethernets: eth0: dhcp4: yes dhcp6: yes Id like to add a line: network: version: 2 renderer: networkd ethernets: eth0: dhcp4: yes dhcp6: yes dhcp-identifier: mac How can I

[Puppet Users] Augeas-1.5.0 to edit file using Puppet

2017-03-30 Thread Shrawan Bhagwat
Hi All, I have configured Puppet 3.8.1 and Augeas 1.5.0. I am trying to edit /etc/hosts file using augeas with following code: augeas{'host_file': context => "/files/etc/hosts", changes => [ "set ipaddr 192.168.0.1", "set canonical

Re: [Puppet Users] Augeas and custom lenses?

2017-02-16 Thread otheus uibk
Ah, documented bug: https://tickets.puppetlabs.com/browse/FACT-696 On Thu, Feb 16, 2017 at 8:48 PM, otheus uibk wrote: > Dom, Sorry about resurrecting the old thread. About facts: `facter -p` > (2.4.6) shows puppet facts, but not the ones loaded via puppet modules in >

Re: [Puppet Users] Augeas and custom lenses?

2017-02-16 Thread otheus uibk
Dom, Sorry about resurrecting the old thread. About facts: `facter -p` (2.4.6) shows puppet facts, but not the ones loaded via puppet modules in /var/lib/puppet/facts.d (unless --external-dir is specified). For that reason, perhaps, we started putting ours in /etc/facter. -- You received this

Re: [Puppet Users] Augeas and custom lenses?

2017-02-15 Thread Dominic Cleal
On 15/02/17 10:38, otheus uibk wrote: > Hi Dom, > > The puppet documentation you references is just slight on details (well, > that could be said about lots of projects these days). If you're replying to a five year old thread(!), some context would be handy. For reference:

Re: [Puppet Users] Augeas and custom lenses?

2017-02-15 Thread otheus uibk
Hi Dom, The puppet documentation you references is just slight on details (well, that could be said about lots of projects these days). Does puppet put such lenses in its own directory? Does puppet ensure such lenses override the "default" ones mentioned in the augtool page? All that is

[Puppet Users] Augeas help

2016-06-10 Thread mike r
Hello, Im tryign to use Augeas in my manifest to manage /etc/fstab file specifically I want to make sure my /etc/fstab file has the following line /tmp /tmp nodev,noexec 0 0 Augeas syntax is like learning Chinese, Im trying to make my manifest figure out whether 1) /etc/fstab has a line

Re: [Puppet Users] Augeas type: Removing an entry from /etc/hosts

2015-10-08 Thread Seth Rice
I know this is way late, by 5 years or so, but I wanted to share what I just discovered, related to your post. Since your post did help me discover it after all. I only got into augeas 4 days ago, and puppet about a month ago. Though augeas is a harsh mistress, I found that you can do some

Re: [Puppet Users] Augeas failing when acting on smb.conf

2015-08-04 Thread Martin
Hi, While no help at all for Augeas: Why don't you simply use a template? It would also get rid of the exec at the end? /Martin On Mon 3 Aug 2015 at 23:04 Fabrizio Zelaya fabr...@gmail.com wrote: Hello everyone! I am trying to run puppet agent on a SL-6 Machine and one action I'm trying to

[Puppet Users] Augeas failing when acting on smb.conf

2015-08-03 Thread Fabrizio Zelaya
Hello everyone! I am trying to run puppet agent on a SL-6 Machine and one action I'm trying to apply is to add the machine to our domain. However I ran into an issue when running puppet agent -t Debug: Augeas[global](provider=augeas): Opening augeas with root /, lens path

Re: [Puppet Users] Augeas: Skipping because no files were changed

2015-07-08 Thread Chris Lee
Thanks Ian, I had tried with and without the context, also tried with set and setm, tried to include the values first... but nothing worked. I was about to go insane and through to remove the trailing slash in the changes... augeas { 'grub.conf/8250_LAR': incl =

Re: [Puppet Users] Augeas: Skipping because no files were changed

2015-07-07 Thread Ian Mortimer
On Tue, 2015-07-07 at 07:33 -0700, Chris Lee wrote: I am trying to add two new options to grub.conf using augeas. The code is as follows: augeas { 'grub.conf/8250_LAR': tag = chris1, incl= '/boot/grub/grub.conf', lens= 'Grub.lns',

Re: [Puppet Users] Augeas: Skipping because no files were changed

2015-07-07 Thread Ian Mortimer
On Tue, 2015-07-07 at 07:33 -0700, Chris Lee wrote: I am trying to add two new options to grub.conf using augeas. The code is as follows: augeas { 'grub.conf/8250_LAR': tag = chris1, incl= '/boot/grub/grub.conf', lens= 'Grub.lns',

[Puppet Users] Augeas: Skipping because no files were changed

2015-07-07 Thread Chris Lee
I am trying to add two new options to grub.conf using augeas. The code is as follows: augeas { 'grub.conf/8250_LAR': tag = chris1, incl= '/boot/grub/grub.conf', lens= 'Grub.lns', changes = [ 'set

Re: [Puppet Users] Augeas resource type for Windows?

2015-06-04 Thread Josh Cooper
On Wed, Jun 3, 2015 at 8:38 AM, Charlie Baum charlieb...@gmail.com wrote: I want to use Augeas to manage/change some XML files using my puppet manifest. I'd really prefer not to use templates, and Augeas seems like it does what I want. However when I try it, my Windows event log says there

[Puppet Users] Augeas resource type for Windows?

2015-06-03 Thread Charlie Baum
I want to use Augeas to manage/change some XML files using my puppet manifest. I'd really prefer not to use templates, and Augeas seems like it does what I want. However when I try it, my Windows event log says there is no suitable provider for Augeas. Is that provider not supported on

Re: [Puppet Users] Augeas editing of fstab

2015-03-23 Thread Wil Cooley
On Fri, Mar 20, 2015 at 7:20 AM Anthony Clark dizzysau...@gmail.com wrote: Hi there, I'm trying to add the nobarrier option to our XFS mount options in /etc/fstab using Augeas. I've tried this: Could you perhaps post working and failing examples of fstab entries? Wil -- You received

[Puppet Users] Augeas editing of fstab

2015-03-20 Thread Anthony Clark
Hi there, I'm trying to add the nobarrier option to our XFS mount options in /etc/fstab using Augeas. I've tried this: augeas { 'fstabxfsnobarrier': context = '/files/etc/fstab', changes = [ 'rm /*[vfstype=xfs]/opt', 'ins opt after vfstype=xfs', 'set /*[vfstype=xfs]/opt[last()] defaults',

[Puppet Users] Augeas fstab - removing all opt nodes then rebuilding

2015-02-04 Thread Anthony Clark
Hello All, I have a requirement to mount /var with specific options if mysql-server is installed and the filesystem is ext4. So far I have this: if defined(Package['mysql55-server']) { notice found mysql server augeas { 'fstabvarentry': context =

[Puppet Users] augeas failure - any ideas?

2014-12-10 Thread James Green
augeas { 'postfix-master-smtp-inet' : context = /files/etc/postfix/master.cf, changes = [ set smtp[type = inet]/private n, set smtp[type = inet]/unprivileged -, set smtp[type = inet]/chroot n, set smtp[type = inet]/wakeup -, set smtp[type = inet]/limit 10,

[Puppet Users] augeas inittab whitespaces and single/double quotes, backslash

2014-11-03 Thread Oleksandr Yudin
Hi everyone. I am attempting to add this line to /etc/inittab: TS0:23:respawn:/sbin/mgetty -m ' \d\dAT OK' ttyS0 Here is the puppet manifest I am trying to make: augeas {/etc/inittab: context = /files/etc/inittab, changes = [ set TS0/runlevels 23, set

[Puppet Users] Augeas and idempotency

2014-10-20 Thread Kenton Brede
I'd like to add a this file managed by puppet line to the top of the files I manage with augeas. This works but is not idempotent. I could add an onlyif but then if I want to change SELINUX to off I won't be able to, since the comment will always exist. augeas { 'selinux_config': context =

Re: [Puppet Users] Augeas and idempotency

2014-10-20 Thread Trevor Vaughan
Being a file with only two options, do you need to use Augeas? Why not just manage the whole file? The only time you wouldn't do this is if you expect someone to independently change variables in the file either by hand or with another tool later and you do not want to change them back. Trevor

Re: [Puppet Users] Augeas and idempotency

2014-10-20 Thread Kenton Brede
This is a proof of concept if you will. Just using this as a simple example. I've got a lot of files I'd like to add a managed by Puppet header to. There's two camps. Manage the whole file or edit in place. I realize Puppet users are mostly of the former. I'm of the latter. Thanks, Kent On

Re: [Puppet Users] Augeas and idempotency

2014-10-20 Thread Trevor Vaughan
It comes down to your use case. You may find that writing custom types/providers is easier than using Augeas (it certainly is for me in general). Also, remember that editing LOTS of files creates LOTS of resources and relationships which means a longer compile time (fewer nodes able to be

Re: [Puppet Users] augeas, sshd and multiple onlyif requirements

2014-10-12 Thread Chris
On 10/10/14 16:29, John Warburton wrote: On 10 October 2014 13:34, Chris dmag...@gmail.com mailto:dmag...@gmail.com wrote: Any help, suggestions, alternatives would be greatly appreciated. Stop using Augeas and start using templates https://docs.puppetlabs.com/guides/templating.html I

[Puppet Users] augeas, sshd and multiple onlyif requirements

2014-10-09 Thread Chris
Hi all, I'm trying to insert a ClientAliveInterval setting into sshd_config with augeas. Some servers have a Match User line (so the new setting needs to come before the Match User line), and some don't. Some already have a ClientAliveInterval setting, and some don't. My first attempt was

Re: [Puppet Users] augeas, sshd and multiple onlyif requirements

2014-10-09 Thread John Warburton
On 10 October 2014 13:34, Chris dmag...@gmail.com wrote: Any help, suggestions, alternatives would be greatly appreciated. Stop using Augeas and start using templates https://docs.puppetlabs.com/guides/templating.html Here's an extreme example from the the most popular SSH module

[Puppet Users] augeas and multiple values attribute

2014-08-19 Thread Vadym Chepkov
Hi, How can I use puppet's augeas type to configure parameters with multiple values? For instance, sshd_config can have multiple HostKeys parameters: augtool print /files/etc/ssh/sshd_config/HostKey /files/etc/ssh/sshd_config/HostKey[1] = /etc/ssh/ssh_host_rsa_key

Re: [Puppet Users] Augeas hates me!!!

2014-08-14 Thread Poil
Hi, I think you can use file_line from stdlib https://forge.puppetlabs.com/puppetlabs/stdlib#file_line It's really more simple than Augeas and it works better. For multi-line I also use editfile a custom module, but you need to be good with regex =)

[Puppet Users] Augeas hates me!!!

2014-08-12 Thread randal cobb
Hello, all! I am trying to add some new modules to an openSuse 13.1 host with Puppet and Augeas with no luck. The modules themselves are already installed by the example42/apache module, but I can't get the apache::module syntax to properly add the modules to the proper openSuse config files.

Re: [Puppet Users] augeas error with erwbgy/system module

2014-07-02 Thread Dominic Cleal
On 01/07/14 21:38, Arpin Dominique (Nter) wrote: Hi, I install the erwbgy/system module, I have those errors : Debug: Augeas[ntp-servers](provider=augeas): Opening augeas with root /, lens path , flags 64 Debug: Augeas[ntp-servers](provider=augeas): Augeas version 1.2.0 is installed

[Puppet Users] augeas error with erwbgy/system module

2014-07-01 Thread Arpin Dominique (Nter)
Hi, I install the erwbgy/system module, I have those errors : Debug: Augeas[ntp-servers](provider=augeas): Opening augeas with root /, lens path , flags 64 Debug: Augeas[ntp-servers](provider=augeas): Augeas version 1.2.0 is installed Warning: Augeas[ntp-servers](provider=augeas): Loading

Re: [Puppet Users] augeas for setting URIEncoding variable in tomcat, server.xml file.

2014-05-08 Thread Kenton Brede
Try something like this: augeas { 'update_server.xml': lens= 'Xml.lns', context = '/files/opt/apphome/apache-tomcat-7.0.53/conf/server.xml/Server/Service/Connector[*]/#attribute/', incl = /opt/apphome/apache-tomcat-7.0.53/conf/server.xml, changes = ['ins URIEncoding

Re: [Puppet Users] augeas for setting URIEncoding variable in tomcat, server.xml file.

2014-05-08 Thread Pradeep Reddy
Thx Kent. On 8 May 2014 18:25, Kenton Brede kbr...@gmail.com wrote: Try something like this: augeas { 'update_server.xml': lens= 'Xml.lns', context = '/files/opt/apphome/apache-tomcat-7.0.53/conf/server.xml/Server/Service/Connector[*]/#attribute/', incl =

Re: [Puppet Users] augeas for setting URIEncoding variable in tomcat, server.xml file.

2014-05-08 Thread Kenton Brede
And that's not going to work so hot because you're going to keep getting this on every run: Error: /Stage[main]/Test_module/Augeas[update_server.xml]: Could not evaluate: Saving failed, see debug To avoid this you can use an onlyif. onlyif = 'match URIEncoding[. = UTF-8] size == 0', This will

[Puppet Users] augeas for setting URIEncoding variable in tomcat, server.xml file.

2014-05-07 Thread Pradeep Reddy
Hi Team, I am using below info in my manifest. URIEncoding=UTF-8 is not present in server.xml. Trying to inject URIEncoding using below augeas syntax. augeas { 'update_server.xml': lens= 'Xml.lns', incl = /opt/apphome/apache-tomcat-7.0.53/conf/server.xml,

[Puppet Users] Augeas Question

2014-04-28 Thread Pete Hartman
I hope this is an appropriate place for this question; if not, any redirection to a more appropriate place is appreciated. So: I'm trying to set up puppet + augeas on an opensolaris system. There are certain files I have that are under RCS version control--this is not all my doing, so some of

Re: [Puppet Users] Augeas Question

2014-04-28 Thread Kenton Brede
Not ab augeas expert but IIRC what I did in a similar situation is force puppet/augeas to point to only one file. Try adding context, incl, and lens to your augeas definition, like the example below. By specifying the lens, I think it helps speed up the augeas type also. At least I read that

Re: [Puppet Users] augeas with puppet : cannot update line

2014-04-23 Thread Kenton Brede
First, it looks to me like you have a typo. I don't have a my.cnf handy ATM but I'd think setbind-adress should be setbind-address. Second, do you have augeas-libs installed on your target system? The system you wish the changes to be made need /usr/share/augeas/lenses/dist/* in place. I

[Puppet Users] augeas with puppet : cannot update line

2014-04-22 Thread cheniour ghassen
Hi everyone, I am new in puppet. In fact i am trying to update bind-address in the mysql file '/etc/mysql/my.cnf i wrote the this code in manifests/nodes.pp augeas { 'update-bind-address': context = '/files/etc/mysql/my.cnf', changes = ['setbind-adress 192.168.80.135'], } when i

[Puppet Users] Augeas lens to change an arbitrary line in a file?

2014-04-21 Thread Joachim Schrod
Hi, I'm new to Puppet, and also new to Augeas. I want to change a line in a file. In particular, the file is /usr/share/ghostscript/${gs_version}/Resource/Init/gs_init.ps and the line is % /DEFAULTPAPERSIZE (a4) def that I want to change into /DEFAULTPAPERSIZE (a4) def Is Augeas the right

[Puppet Users] augeas, syslog and defining numbered items.

2014-03-13 Thread trey85stang
How can one change an existing entry with augeas on a numbered entry list? specifically I want to add entries in syslog to the entry that has file = /var/log/messages I can use this search string to find the entry: augtool print /files/etc/syslog.conf/*/action/file[. = /var/log/messages]

[Puppet Users] augeas, ntp.conf and iburst

2014-03-12 Thread Kenton Brede
I want to add a server on top of the stack in ntp.conf like: server time.example.com iburst server 0.rhel.pool.ntp.org iburst ... I came up with this: augeas { 'ntp.conf': context = '/files/etc/ntp.conf', changes = [ 'ins server before server[1]', 'set server[1]

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-18 Thread Ryan Anderson
Excellent catch, the error was indeed an improperly-formatted /etc/group entry (on line 51). Thanks for your help! I've learned a lot about augeas through this. The old adage applies: garbage in, garbage out. On Monday, February 17, 2014 10:18:46 AM UTC-6, Dominic Cleal wrote: The fix that

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-17 Thread Dominic Cleal
The fix that Marcelo pointed out isn't relevant here, it's to fix a false positive log message. The log message is actually correct in this instance, no need to update augeas.rb. The Augeas library is unable to parse something on line 51 of your /etc/group file. From the debug:

[Puppet Users] Augeas with puppet 3.4.2

2014-02-13 Thread Ryan Anderson
I have some augeas code that works flawlessly with puppet 2.6.17, but when running the identical code on 3.4.2, I get an error. The code: augeas { 'myuser_in_logingroup': context = '/files/etc/group', changes = [ set ${hostname}/user[last()+1] myuser, ], onlyif

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-13 Thread Rob Reynolds
On Thu, Feb 13, 2014 at 9:54 AM, Ryan Anderson ryan.c.ander...@gmail.comwrote: I have some augeas code that works flawlessly with puppet 2.6.17, but when running the identical code on 3.4.2, I get an error. The code: augeas { 'myuser_in_logingroup': context =

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-13 Thread gter marcelo
Hi, I had the same problem, the solution of the problem is in : https://github.com/puppetlabs/puppet/commit/644fc99193dd5e2beed3facbccb949caf8d6501f , Best regards, Marcelo Frota 2014-02-13 14:23 GMT-02:00 Rob Reynolds r...@puppetlabs.com: On Thu, Feb 13, 2014 at 9:54 AM, Ryan Anderson

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-13 Thread Ryan Anderson
Cool. Does this mean I need to update augeas.rb from github.com or wait for it to make it into a future release? What should I do to fix it now? In case it helps, here are the problem bits from the debug output: ^[[0;32mInfo: Applying configuration version '1392322307'^[[0m ^[[0;36mDebug:

Re: [Puppet Users] Augeas with puppet 3.4.2

2014-02-13 Thread Ryan Anderson
Cool. Does this mean I need to update augeas.rb from github.com or wait for it to make it into a future release? What should I do to fix it now? In case it helps, here are the problem bits from the debug output: ^[[0;32mInfo: Applying configuration version '1392322307'^[[0m ^[[0;36mDebug:

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-20 Thread Reinaldo Lima
Almost there! =) My only change was 'host_entry_${name} :' like you suggested, everything else in the code is like my first post, and the error now is: *Could not evaluate: uninitialized constant Augeas::NO_MODL_AUTOLOAD* *By the way, thank you so much for the help, this topic made me learn a

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-18 Thread Nick Cammorato
Sorry, didn't realize it was a hash of hashes. You just need the augeas resource to have a unique name - entry[$name][hostname] or ipaddress should work. IE: define a_thing { augeas { 'host_entry': } } a_thing { 'a': } a_thing { 'b': } Will generate an error like you are seeing. define

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-17 Thread Reinaldo Lima
With create_resources the error is: *Invalid parameter hostName on node* And including the entry[name] in the resource name: *Resource title must be a String, not Hash* =( On Friday, January 17, 2014 5:10:16 AM UTC-2, Andrew wrote: another option to use

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-17 Thread Andrey Kozichev
ah, right you are supplying entire hash in your defined resource. Missed it. If your defined resource would accept: name, iphost and hostname - then you can use create_resources to define all 3 entry. On 17 Jan 2014 15:21, Reinaldo Lima reiml...@gmail.com wrote: With create_resources the error

[Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Reinaldo Lima
Hi Everyone, I'm trying to write a class that put some entries in /etc/hosts file as follow below: *class hosts {* *$netentry = {* *host01 = { iphost = '192.168.10.1', hostName = host01 },* *host02 = { iphost = '192.168.10.2', hostName = host02 },* *

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Nick Cammorato
Your augeas resource is always called hosts_include which is why it's doing that. Try including the entry[name] in that resource name. On Jan 16, 2014 4:15 PM, Reinaldo Lima reiml...@gmail.com wrote: Hi Everyone, I'm trying to write a class that put some entries in /etc/hosts file as follow

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Andrey Kozichev
another option to use create_resources('hostinclude',$netentry) On 16 Jan 2014 23:47, Nick Cammorato nick.cammor...@gmail.com wrote: Your augeas resource is always called hosts_include which is why it's doing that. Try including the entry[name] in that resource name. On Jan 16, 2014 4:15 PM,

Re: [Puppet Users] augeas onlyif problem

2013-11-14 Thread Jist Anidiot
On Monday, November 11, 2013 5:06:30 PM UTC-5, Dominic Cleal wrote: On 11/11/13 15:18, Jist Anidiot wrote: On Friday, November 8, 2013 12:23:11 PM UTC-5, Dominic Cleal wrote: On 06/11/13 21:17, Jist Anidiot wrote: I'm trying to make sure a specific user has a special

Re: [Puppet Users] Augeas JSON example?

2013-11-14 Thread John Simpson
On 2013-11-13, at 1456, David Lutterkort lut...@puppetlabs.com wrote: I don't have any examples handy, but the easiest way to try out managing the file with Puppet is to store it somewhere, say /tmp/file.json and then play around with it in augtool: That's what I eventually ended up doing,

Re: [Puppet Users] augeas onlyif problem

2013-11-11 Thread Jist Anidiot
On Friday, November 8, 2013 12:23:11 PM UTC-5, Dominic Cleal wrote: On 06/11/13 21:17, Jist Anidiot wrote: 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 =

Re: [Puppet Users] augeas onlyif problem

2013-11-11 Thread Dominic Cleal
On 11/11/13 15:18, Jist Anidiot wrote: On Friday, November 8, 2013 12:23:11 PM UTC-5, Dominic Cleal wrote: On 06/11/13 21:17, Jist Anidiot wrote: I'm trying to make sure a specific user has a special ssh key used as his identity file. so I'm trying something

Re: [Puppet Users] augeas onlyif problem

2013-11-08 Thread Dominic Cleal
On 06/11/13 21:17, Jist Anidiot wrote: 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

[Puppet Users] augeas onlyif problem

2013-11-06 Thread Jist Anidiot
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()],

[Puppet Users] Augeas JSON example?

2013-11-01 Thread John Simpson
Greetings. I'm trying to find a few concrete examples of how to use augeas within a Puppet module, to make changes to a JSON file. I've been googling for the past hour and a half, and while I have found several pages which provide reference-type documentation, I have yet to see a single usable

Re: [Puppet Users] augeas umask and /etc/sysconfig/init

2013-10-29 Thread Sven vd
I have the same problem. The goal is to append umask 027 without the = to the end of the /etc/sysconfig/init file according to NIST rules. However the augeas lens is not made to handle this, only shell vars syntax is allowed. If you want to workaround this via a erb template and you have other

Re: [Puppet Users] augeas umask and /etc/sysconfig/init

2013-10-29 Thread Dominic Cleal
On 29/10/13 12:07, Sven vd wrote: I have the same problem. The goal is to append umask 027 without the = to the end of the /etc/sysconfig/init file according to NIST rules. However the augeas lens is not made to handle this, only shell vars syntax is allowed. If you want to workaround this

Re: [Puppet Users] Augeas XML trouble

2013-10-11 Thread Neil
On 11 Oct 2013 01:04, Thilo-Alexander Ginkel th...@ginkel.com wrote: Hello everyone, I am currently trying to add elements to an XML file (a libvirt network definition) using Puppet (2.7.23)/Augeas (0.10). The XML looks like this Hello I think you need to upgrade augeas. The xml stuff does

Re: [Puppet Users] Augeas XML trouble

2013-10-11 Thread Puppet List
On 11 Oct 2013 01:04, Thilo-Alexander Ginkel th...@ginkel.com wrote: Hello everyone, I am currently trying to add elements to an XML file (a libvirt network definition) using Puppet (2.7.23)/Augeas (0.10). The XML looks like this Hello upgrade augeas I use 1.1 as the xml features do not work

[Puppet Users] Augeas XML trouble

2013-10-10 Thread Thilo-Alexander Ginkel
Hello everyone, I am currently trying to add elements to an XML file (a libvirt network definition) using Puppet (2.7.23)/Augeas (0.10). The XML looks like this: network namevirbr0/name uuid57fdc6e3-cba1-4110-88ef-850f1b71ee39/uuid forward dev='eth0' mode='nat'/ bridge

Re: [Puppet Users] augeas question

2013-09-24 Thread Greg Coit
I've decided to not be blocked by this issue and to have puppet manage the config file. It's not an ideal solution, but good enough until I learn more about either augeas or inifile. Greg On Monday, September 23, 2013 3:48:05 PM UTC-7, Greg Coit wrote: Nathan, Thanks for the response - I

Re: [Puppet Users] augeas question

2013-09-24 Thread Greg Coit
LOL - or I could just use one of the 2 vsftpd modules on puppetforge... I never *intend* to do things the hard way. :) Greg On Tuesday, September 24, 2013 9:32:53 AM UTC-7, Greg Coit wrote: I've decided to not be blocked by this issue and to have puppet manage the config file. It's not

Re: [Puppet Users] augeas question

2013-09-24 Thread Werner Flamme
Greg Coit [24.09.2013 00:48]: BTW, still playing with augeas too - the most recent code is: augeas { 'vsftpd.conf': context = '/files/vsftpd/vsftpd.conf', Greg, shouldn't this be '/files/etc/vsftpd/vsftpd.conf'? Just a guess from a novice... Regards, Werner -- -- You received

[Puppet Users] augeas question

2013-09-23 Thread Greg Coit
Hello, I'm trying to learn how to use augeas in puppet. One of the packages we have puppet installing is vsftpd. Rather than putting the vsftpd conf file in puppet (in case the config file is updated by the upstream maintainers) I'd like to use augeas to make sure the correct lines exist in

Re: [Puppet Users] augeas question

2013-09-23 Thread Nathan Valentine
Greg, I believe resource ini_setting would be appropriate here but I do understand the desire to learn about Puppet + Augeas. augeas { 'vsftpd.conf': context = '/etc/vsftpd/vsftpd.conf', changes = [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ], require =

Re: [Puppet Users] augeas question

2013-09-23 Thread Greg Coit
Nathan, Thanks for the response - I did not know about inifile. I unfortunately seem to be having trouble with ini_setting - the following causes a new line to be added every time puppet gets run: ini_setting { 'anonymous_enable': path= '/etc/vsftpd/vsftpd.conf', setting =

[Puppet Users] Augeas, fstab and duplicate lines: How to test ? (onlyif ? not_include ?) ... Examples ?

2013-07-29 Thread haraldchris
Hi, I am trying to define a new type that will insert a new filesystem line into /etc/fstab. However, no matter what I tried, it will insert a new line each time. Something like this doesn't work augeas { $title: context = '/files/etc/fstab', changes = [

Re: [Puppet Users] augeas umask and /etc/sysconfig/init

2013-06-25 Thread Dominic Cleal
On 24/06/13 12:22, David Sandilands wrote: We are working on a replacing our current build set by ksh scripts with puppet manifests and I'm having some difficulty setting umask in /etc/sysconfig/init for RHEL 6 Ideally I would like to just do augeas { 'augsysconfiginitumask':

[Puppet Users] augeas umask and /etc/sysconfig/init

2013-06-24 Thread David Sandilands
We are working on a replacing our current build set by ksh scripts with puppet manifests and I'm having some difficulty setting umask in /etc/sysconfig/init for RHEL 6 Ideally I would like to just do augeas { 'augsysconfiginitumask': context = '/files/etc/sysconfig/init',

[Puppet Users] augeas umask and /etc/sysconfig/init

2013-06-24 Thread David Sandilands
Hello, I'm trying to add a line for umask setting to /etc/sysconfig/init with something like augeas { 'augsysconfiginitumask': context = '/files/etc/sysconfig/init', changes = 'set umask 027'; } but this just produces umask=027 in the file we could use a

Re: [Puppet Users] augeas

2013-06-19 Thread Dominic Cleal
On 18/06/13 23:07, Charles Mean wrote: Hello guys, I am facing a problem with puppet client installed via gem due Ruby EE. The problem is the following: puppetd -vt info: Caching catalog for #FQDN err: Could not run Puppet configuration client: Could not find a default provider for augeas

Re: [Puppet Users] augeas

2013-06-19 Thread Charles Mean
Hello Dominic, thank you for your reply. The make error is the following: * gem install ruby-augeas* Building native extensions. This could take a while... ERROR: Error installing ruby-augeas: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb creating Makefile

Re: [Puppet Users] augeas

2013-06-19 Thread Dominic Cleal
On 19/06/13 17:46, Charles Mean wrote: Hello Dominic, thank you for your reply. [snip] make gcc -I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -fPIC -g -O2 -I/usr/include/libxml2-c _augeas.c _augeas.c: In function 'Init__augeas':

Re: [Puppet Users] augeas

2013-06-19 Thread Charles Mean
Great Dominic, this version solved the problem. I have just installed ruby-augeas-0.3.0.gem and puppet is working now =) Thank you for your help. On Wed, Jun 19, 2013 at 2:19 PM, Dominic Cleal dcl...@redhat.com wrote: On 19/06/13 17:46, Charles Mean wrote: Hello Dominic, thank you for your

[Puppet Users] augeas

2013-06-18 Thread Charles Mean
Hello guys, I am facing a problem with puppet client installed via gem due Ruby EE. The problem is the following: puppetd -vt info: Caching catalog for #FQDN err: Could not run Puppet configuration client: Could not find a default provider for augeas I have tried to install ruby-augeas(gem

[Puppet Users] augeas for hosts.allow

2013-05-29 Thread mohammad kashif
Hi I am trying to configure hosts.allow using augeas with puppet. I can add a ip range if process exists with this code augeas { Add ${name} to ${process}: context = /files/etc/hosts.allow, changes = set *[process='${process}']/client[last()+1] ${name}, onlyif = match

[Puppet Users] augeas

2013-04-29 Thread Stanislas LEVEAU
Hello I use augeas to replace a value in a config file: example (this example is good) : /etc/ssh/sshd_config file LogLevel INFO class ssh::redhat { augeas { sshd_config: context = /files/etc/ssh/sshd_config, changes = [ set LogLevel VERBOSE, ], notify = Service[sshd], } This

Re: [Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-28 Thread Dominic Cleal
On 22/03/13 23:22, Gonzalo Servat wrote: On Sat, Mar 23, 2013 at 9:47 AM, Gonzalo Servat gser...@gmail.com mailto:gser...@gmail.com wrote: On Fri, Mar 22, 2013 at 9:11 PM, Dominic Cleal dcl...@redhat.com mailto:dcl...@redhat.com wrote: Perhaps ideally, lenses could be

Re: [Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-27 Thread Nikola Petrov
I think that this is mostly because of lens that are written this way. We shouldn't blame them that this is poorly written in my opinion. It is just more restrictive. Lens that I have written accept a regular expression as an identifier instead of listing them. Best, Nikola On Fri, Mar 22, 2013

Re: [Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-22 Thread Dominic Cleal
On 22/03/13 04:02, Gonzalo Servat wrote: Hi All, I just ran into a frustrating Augeas problem, which I thought I'd share with you all. We run a cron every morning to fetch the latest RPMs (for the packages we're interested in) from various places such as rpmforge, EPEL, etc. This

Re: [Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-22 Thread Gonzalo Servat
On Fri, Mar 22, 2013 at 9:11 PM, Dominic Cleal dcl...@redhat.com wrote: Perhaps ideally, lenses could be bundled with the software responsible for the config file formats themselves so they're more easily kept in sync. There are a small number of projects that do this (libvirt, libguestfs,

Re: [Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-22 Thread Gonzalo Servat
On Sat, Mar 23, 2013 at 9:47 AM, Gonzalo Servat gser...@gmail.com wrote: On Fri, Mar 22, 2013 at 9:11 PM, Dominic Cleal dcl...@redhat.com wrote: Perhaps ideally, lenses could be bundled with the software responsible for the config file formats themselves so they're more easily kept in sync.

[Puppet Users] Augeas lens dependency on valid config file parsing

2013-03-21 Thread Gonzalo Servat
Hi All, I just ran into a frustrating Augeas problem, which I thought I'd share with you all. We run a cron every morning to fetch the latest RPMs (for the packages we're interested in) from various places such as rpmforge, EPEL, etc. This morning I tried to build a VM and it failed. What

Re: [Puppet Users] Augeas and defvar -- regexp

2013-02-05 Thread Dominic Cleal
On 01/02/13 10:35, Schöke, Karsten wrote: Hallo, I have a problem to include augeas… I will to change a comment to a entry in /etc/default/tmpfs in Debian Wheezy. The comment is #RAMTMP=no I try this on augtool und it is running: augtool defvar ramtmpcomment

[Puppet Users] Augeas and defvar -- regexp

2013-02-01 Thread Schöke, Karsten
Hallo, I have a problem to include augeas... I will to change a comment to a entry in /etc/default/tmpfs in Debian Wheezy. The comment is #RAMTMP=no I try this on augtool und it is running: augtool defvar ramtmpcomment /files/etc/default/tmpfs/#comment[.=~regexp('RAMTMP=no')]

Re: [Puppet Users] Augeas file line edit please help

2013-01-24 Thread Dominic Cleal
On 24/01/13 04:28, kdo wrote: what i thought would be a simple edit using augeas is turning out to not be so straight forward, can anyone please help ? the plan is to edit sendmail.cf and change the default DS to DShostname.domain class mail { $key = DS service {

  1   2   3   >