File tree 4 files changed +24
-0
lines changed
4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 51
51
subprocess .check_call ('sudo chmod 700 ~root/.ssh' , shell = True )
52
52
subprocess .check_call ('sudo chmod 600 ~root/.ssh/authorized_keys' , shell = True )
53
53
54
+ ci_lib .run ("ansible-playbook -c local -i localhost, macos_localhost.yml" )
55
+
54
56
if os .path .expanduser ('~mitogen__user1' ) == '~mitogen__user1' :
55
57
os .chdir (IMAGE_PREP_DIR )
56
58
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 1
1
sshd_config_file : /etc/ssh/sshd_config
2
+
3
+ sshd_config__max_auth_tries : 50
Original file line number Diff line number Diff line change 12
12
loop :
13
13
- line : Banner /etc/ssh/banner.txt
14
14
regexp : ' ^#? *Banner.*'
15
+ - line : MaxAuthTries {{ sshd_config__max_auth_tries }}
16
+ regexp : ' ^#? *MaxAuthTries.*'
15
17
- line : PermitRootLogin yes
16
18
regexp : ' .*PermitRootLogin.*'
17
19
loop_control :
18
20
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