Created
April 12, 2017 06:23
-
-
Save jmlrt/eb3b7a2fce94e7b216887754af76a3db to your computer and use it in GitHub Desktop.
Ansible C1 Playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: c1 | |
| become: yes | |
| tasks: | |
| - name: ensure ssh root login is disabled | |
| lineinfile: | |
| dest: /etc/ssh/sshd_config | |
| state: present | |
| regexp: "^PermitRootLogin" | |
| line: PermitRootLogin no | |
| notify: reload ssh | |
| tags: ssh | |
| - name: ensure ssh password login is disabled | |
| lineinfile: | |
| dest: /etc/ssh/sshd_config | |
| state: present | |
| regexp: "^PasswordAuthentication" | |
| line: PasswordAuthentication no | |
| notify: reload ssh | |
| tags: ssh | |
| handlers: | |
| - name: reload ssh | |
| service: | |
| name: ssh | |
| state: reloaded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment