Re: [ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-11-09 Thread Suresh Karpurapu
thank you so much Vladimir and Jorge Regards, Suresh On Fri, Oct 29, 2021 at 3:11 AM Vladimir Botka wrote: > On Fri, 29 Oct 2021 01:57:17 +0530 > Suresh Karpurapu wrote: > > > > > # grep AllowGroups /etc/ssh/sshd_config > > > > AllowGroups x y z > > > > > > > > # grep AllowGroups

Re: [ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-10-28 Thread Vladimir Botka
On Fri, 29 Oct 2021 01:57:17 +0530 Suresh Karpurapu wrote: > > > # grep AllowGroups /etc/ssh/sshd_config > > > AllowGroups x y z > > > > > > # grep AllowGroups /etc/ssh/sshd_config > > > AllowGroups x y z a <-group "a" needs to be added at > > > the end of the line > >

Re: [ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-10-28 Thread Jorge Rúa
Try this: https://dpaste.com/5ENHWDV7Q Remember to update the sshd_config to the proper path ie. /etc/ssh/sshd_config ➜ ~ grep '^AllowGroups' sshd_config AllowGroups a b c ➜ ~ ansible-playbook -i localhost, allow.yml PLAY [Configure sshd groups]

Re: [ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-10-28 Thread Suresh Karpurapu
Thank you so much Vladimir, How can we loop if we need to append multiple groups. Regards, Suresh On Thu, 28 Oct 2021, 6:21 pm Vladimir Botka, wrote: > On Thu, 28 Oct 2021 05:28:27 -0700 (PDT) > Suresh Karpurapu wrote: > > > # grep AllowGroups /etc/ssh/sshd_config > > AllowGroups x y z > >

Re: [ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-10-28 Thread Vladimir Botka
On Thu, 28 Oct 2021 05:28:27 -0700 (PDT) Suresh Karpurapu wrote: > # grep AllowGroups /etc/ssh/sshd_config > AllowGroups x y z > > # grep AllowGroups /etc/ssh/sshd_config > AllowGroups x y z a <-group "a" needs to be added at > the end of the line Enable *backrefs*

[ansible-project] How to append the new group to the existing AllowGroups line in /etc/ssh/sshd_config

2021-10-28 Thread Suresh Karpurapu
Hi Experts, I would like to append the new group to the existing AllowGroups in /etc/ssh/sshd_config file without disturbing the existing group. I tried with lineinfile module but unfortunately its failing or overwriting existing groups. Can anyone please provide the clue on logic? existing