Skip to content

Instantly share code, notes, and snippets.

@trlinkin
Created March 5, 2019 22:43
Show Gist options
  • Save trlinkin/313e6431e02fc9b2c170a73f496fb927 to your computer and use it in GitHub Desktop.
Save trlinkin/313e6431e02fc9b2c170a73f496fb927 to your computer and use it in GitHub Desktop.
Augeas to resolve duplicates and set the correct entry in sshd_config
augeas { "sshd_config":
changes => [
"rm /files/etc/ssh/sshd_config/AllowTcpForwarding",
"set /files/etc/ssh/sshd_config/AllowTcpForwarding yes",
],
}
[root@master ~]# cat /etc/ssh/sshd_config | grep AllowTcpForwarding
#AllowTcpForwarding yes
AllowTcpForwarding yes
AllowTcpForwarding no
AllowTcpForwarding yes
[root@master ~]# puppet apply /tmp/aug.pp
Notice: Compiled catalog for master.pe-lab-2019.puppet.vm in environment production in 0.09 seconds
Notice: /Stage[main]/Main/Augeas[sshd_config]/returns: executed successfully
Notice: Applied catalog in 1.47 seconds
[root@master ~]# cat /etc/ssh/sshd_config | grep AllowTcpForwarding
#AllowTcpForwarding yes
AllowTcpForwarding yes
[root@master ~]# puppet apply /tmp/aug.pp
Notice: Compiled catalog for master.pe-lab-2019.puppet.vm in environment production in 0.06 seconds
Notice: Applied catalog in 1.40 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment