Skip to content

Commit

Permalink
ci: fix ansible-lint issue in tests_user_config.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Nov 14, 2023
1 parent fd99e9a commit 0858fbf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/tests_user_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- /etc/ssh/ssh_config.d/00-ansible.conf
- /etc/ssh/ssh_config
username: tester123
__become_method: "{{ 'su' if ansible_version.full is version('2.10', '<')
else 'ansible.builtin.su' }}"
tasks:
- name: Backup configuration files
include_tasks: tasks/backup.yml
Expand Down Expand Up @@ -51,7 +53,7 @@
- name: Stat the .ssh dir
become: true
become_user: "{{ username }}"
become_method: su
become_method: "{{ __become_method }}"
stat:
path: "/home/{{ username }}/.ssh"
register:
Expand All @@ -68,7 +70,7 @@
- name: Make sure the file is readable by user
become: true
become_user: "{{ username }}"
become_method: su
become_method: "{{ __become_method }}"
stat:
path: "/home/{{ username }}/.ssh/config"

Expand Down Expand Up @@ -100,7 +102,7 @@
- name: Test the effective configuration using ssh
become: true
become_user: "{{ username }}"
become_method: su
become_method: "{{ __become_method }}"
command: ssh -vvv -G example
register: effective
when:
Expand Down

0 comments on commit 0858fbf

Please sign in to comment.