augeas umask and /etc/sysconfig/init

659 views
Skip to first unread message

David Sandilands

unread,
Jun 24, 2013, 7:22:42 AM6/24/13
to puppet...@googlegroups.com
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',
               changes => "set umask 027";
                }

but that just sets a line to umask=027, we use augeas to update this file from other places so ideally wouldn't like to use templates.

Any ideas or thoughts?

ruby-augeas-0.4.1-1.el6.x86_64
augeas-libs-0.9.0-4.el6.x86_64
puppet-3.1.1-1.el6.noarch
puppet-server-3.1.1-1.el6.noarch

Dominic Cleal

unread,
Jun 25, 2013, 10:36:22 AM6/25/13
to puppet...@googlegroups.com
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':
> context => '/files/etc/sysconfig/init',
> changes => "set umask 027";
> }
>
> but that just sets a line to umask=027, we use augeas to update this
> file from other places so ideally wouldn't like to use templates.
>
> Any ideas or thoughts?

I don't follow your question. What did you expect or want it to do?

--
Dominic Cleal
Red Hat Engineering

Sven vd

unread,
Oct 29, 2013, 8:07:12 AM10/29/13
to puppet...@googlegroups.com
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 augeas resources defined, they will fail as augeas will fail to parse the new /etc/sysconfig/init set by the template.

How to best resolve this?

Thanks

Dominic Cleal

unread,
Oct 29, 2013, 8:51:33 AM10/29/13
to puppet...@googlegroups.com
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 via a erb template and you have other
> augeas resources defined, they will fail as augeas will fail to parse
> the new /etc/sysconfig/init set by the template.
>
> How to best resolve this?

Please file a bug against Augeas' shellvars lens in order to support
parsing it: https://fedorahosted.org/augeas/newticket

In the meantime, perhaps use file_line or similar tools.
Reply all
Reply to author
Forward
0 new messages