Using augeas to insert two lines unless they alrdy exist

33 views
Skip to first unread message

Erling Ringen Elvsrud

unread,
May 22, 2014, 4:21:36 AM5/22/14
to puppet...@googlegroups.com
Hi,

I try to accomplish this with Puppet / Augeas:

Insert:
Match User <foo>
   banner "none"

at the end of /etc/ssh/sshd_config unless the two lines are alredy present.

I'm aware of the sshd_config_provider from http://augeasproviders.com which seems like the simplest solution for this,
but at this time I cannot change the puppet installation to support this.

I appreciate if anyone can post a suggested solution for this task.

Best regards,

Erling

Ian Mortimer

unread,
May 22, 2014, 11:05:30 PM5/22/14
to puppet...@googlegroups.com
On 05/22/14 18:21, Erling Ringen Elvsrud wrote:

> I try to accomplish this with Puppet / Augeas:
>
> Insert:
> Match User <foo>
> banner "none"
>
> at the end of /etc/ssh/sshd_config unless the two lines are alredy present.
> ...
> I appreciate if anyone can post a suggested solution for this task.

set /files/etc/ssh/sshd_config/Match/Condition/User <foo>
set /files/etc/ssh/sshd_config/Match/Settings/banner '"none"'


--
Ian

Reply all
Reply to author
Forward
0 new messages