File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 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+ os .chdir (IMAGE_PREP_DIR )
55+ ci_lib .run ("ansible-playbook -c local -i localhost, macos_localhost.yml" )
56+
5457 if os .path .expanduser ('~mitogen__user1' ) == '~mitogen__user1' :
5558 os .chdir (IMAGE_PREP_DIR )
5659 ci_lib .run ("ansible-playbook -c local -i localhost, _user_accounts.yml" )
Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 11sshd_config_file : /etc/ssh/sshd_config
2+
3+ sshd_config__max_auth_tries : 50
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments