-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1184 from moreati/issue1083-host_key_checking
ansible_mitogen: Templated SSH host key checking
- Loading branch information
Showing
10 changed files
with
58 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- name: Configure macOS | ||
hosts: all | ||
gather_facts: true | ||
strategy: mitogen_free | ||
become: true | ||
roles: | ||
- role: sshd |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sshd_config_file: /etc/ssh/sshd_config | ||
|
||
sshd_config__max_auth_tries: 50 |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
- name: Create login banner | ||
copy: | ||
src: banner.txt | ||
dest: /etc/ssh/banner.txt | ||
mode: u=rw,go=r | ||
|
||
- name: Configure sshd_config | ||
lineinfile: | ||
path: "{{ sshd_config_file }}" | ||
line: "{{ item.line }}" | ||
regexp: "{{ item.regexp }}" | ||
loop: | ||
- line: Banner /etc/ssh/banner.txt | ||
regexp: '^#? *Banner.*' | ||
- line: MaxAuthTries {{ sshd_config__max_auth_tries }} | ||
regexp: '^#? *MaxAuthTries.*' | ||
- line: PermitRootLogin yes | ||
regexp: '.*PermitRootLogin.*' | ||
loop_control: | ||
label: "{{ item.line }}" | ||
register: configure_sshd_result | ||
|
||
- name: Restart sshd | ||
shell: | | ||
launchctl unload /System/Library/LaunchDaemons/ssh.plist | ||
wait 5 | ||
launchctl load -w /System/Library/LaunchDaemons/ssh.plist | ||
changed_when: true | ||
when: | ||
- ansible_facts.distribution == "MacOSX" | ||
- configure_sshd_result is changed |