Skip to content

Commit dc93ec8

Browse files
committed
CI: Increase sshd MaxAuthRetries to 50 on macOS runners
refs mitogen-hq#1186
1 parent 8cfcb66 commit dc93ec8

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.ci/localhost_ansible_tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
subprocess.check_call('sudo chmod 700 ~root/.ssh', shell=True)
5252
subprocess.check_call('sudo chmod 600 ~root/.ssh/authorized_keys', shell=True)
5353

54+
ci_lib.run("ansible-playbook -c local -i localhost, macos_localhost.yml")
55+
5456
if os.path.expanduser('~mitogen__user1') == '~mitogen__user1':
5557
os.chdir(IMAGE_PREP_DIR)
5658
ci_lib.run("ansible-playbook -c local -i localhost, _user_accounts.yml")

tests/image_prep/macos_localhost.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- name: Configure macOS
2+
hosts: all
3+
gather_facts: true
4+
strategy: mitogen_free
5+
become: true
6+
roles:
7+
- role: sshd
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
sshd_config_file: /etc/ssh/sshd_config
2+
3+
sshd_config__max_auth_tries: 50

tests/image_prep/roles/sshd/tasks/main.yml

+13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@
1212
loop:
1313
- line: Banner /etc/ssh/banner.txt
1414
regexp: '^#? *Banner.*'
15+
- line: MaxAuthTries {{ sshd_config__max_auth_tries }}
16+
regexp: '^#? *MaxAuthTries.*'
1517
- line: PermitRootLogin yes
1618
regexp: '.*PermitRootLogin.*'
1719
loop_control:
1820
label: "{{ item.line }}"
21+
register: configure_sshd_result
22+
23+
- name: Restart sshd
24+
shell: |
25+
launchctl unload /System/Library/LaunchDaemons/ssh.plist
26+
wait 5
27+
launchctl load -w /System/Library/LaunchDaemons/ssh.plist
28+
changed_when: true
29+
when:
30+
- ansible_facts.distribution == "MacOSX"
31+
- configure_sshd_result is changed

0 commit comments

Comments
 (0)