mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
[PR #11479/476f2bf6 backport][stable-12] Integration tests: replace ansible_xxx with ansible_facts.xxx (#11480)
Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)
Replace ansible_xxx with ansible_facts.xxx.
(cherry picked from commit 476f2bf641)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
- name: Install sudo package
|
||||
ansible.builtin.package:
|
||||
name: sudo
|
||||
when: ansible_os_family != 'Darwin'
|
||||
when: ansible_facts.os_family != 'Darwin'
|
||||
|
||||
- name: Ensure sudoers directory exists
|
||||
ansible.builtin.file:
|
||||
@@ -211,13 +211,13 @@
|
||||
command:
|
||||
cmd: which visudo
|
||||
register: which_visudo
|
||||
when: ansible_os_family != 'Darwin'
|
||||
when: ansible_facts.os_family != 'Darwin'
|
||||
|
||||
- name: Prevent visudo being executed
|
||||
file:
|
||||
path: "{{ which_visudo.stdout }}"
|
||||
mode: '-x'
|
||||
when: ansible_os_family != 'Darwin'
|
||||
when: ansible_facts.os_family != 'Darwin'
|
||||
|
||||
- name: Attempt command without full path to executable, but enforcing validation with no visudo present
|
||||
community.general.sudoers:
|
||||
@@ -227,7 +227,7 @@
|
||||
commands: systemctl
|
||||
validation: required
|
||||
ignore_errors: true
|
||||
when: ansible_os_family != 'Darwin'
|
||||
when: ansible_facts.os_family != 'Darwin'
|
||||
register: edge_case_3
|
||||
|
||||
- name: Revoke non-existing rule
|
||||
@@ -293,4 +293,4 @@
|
||||
that:
|
||||
- edge_case_3 is failed
|
||||
- "'Failed to find required executable' in edge_case_3.msg"
|
||||
when: ansible_os_family != 'Darwin'
|
||||
when: ansible_facts.os_family != 'Darwin'
|
||||
|
||||
Reference in New Issue
Block a user