File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 77 - /etc/ssh/ssh_config.d/00-ansible.conf
88 - /etc/ssh/ssh_config
99 username : tester123
10+ __become_method : " {{ 'su' if ansible_version.full is version('2.10', '<')
11+ else 'ansible.builtin.su' }}"
1012 tasks :
1113 - name : Backup configuration files
1214 include_tasks : tasks/backup.yml
5153 - name : Stat the .ssh dir
5254 become : true
5355 become_user : " {{ username }}"
54- become_method : su
56+ become_method : " {{ __become_method }} "
5557 stat :
5658 path : " /home/{{ username }}/.ssh"
5759 register :
6870 - name : Make sure the file is readable by user
6971 become : true
7072 become_user : " {{ username }}"
71- become_method : su
73+ become_method : " {{ __become_method }} "
7274 stat :
7375 path : " /home/{{ username }}/.ssh/config"
7476
100102 - name : Test the effective configuration using ssh
101103 become : true
102104 become_user : " {{ username }}"
103- become_method : su
105+ become_method : " {{ __become_method }} "
104106 command : ssh -vvv -G example
105107 register : effective
106108 when :
You can’t perform that action at this time.
0 commit comments