Skip to content

Instantly share code, notes, and snippets.

@scottking2
Created October 25, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottking2/6f408d50871ea10222f0ab9a99bb6597 to your computer and use it in GitHub Desktop.
Save scottking2/6f408d50871ea10222f0ab9a99bb6597 to your computer and use it in GitHub Desktop.
/etc/ssh/sshd_config:
file.line:
- name: /etc/ssh/sshd_config
- mode: replace
- match: "#Banner*"
- content: 'Banner /etc/issue.net'
sshd:
service.running:
- enable: True
- reload: True
- watch:
- file: /etc/ssh/sshd_config
@scottking2
Copy link
Author

I'm having issues with the - match: "#Banner*" it isn't matching "#Banner /etc/ssh/sshd_config" nor is it matching "#Banner none"

Any ideas? is my regex incorrect?

It worked when I had the statement to match: '#Banner none" and applied the state to specific servers. but I want it to work with any server that already has #Banner in the sshd_config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment