CI: Skip unprivileged become tests on MacOS with Ansible < 2.11

Ansible 2.10 and earlier try to use setfacl, which is not present on
MacOS. Ansible 2.11 and later use chmod +a instead.
pull/859/head
Alex Willmer 3 years ago
parent bd086fd519
commit 5fc7fcd112

@ -9,6 +9,11 @@
become_user: slartibartfast
ignore_errors: true
register: out
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen
- name: Verify raw module output.
assert:
@ -20,3 +25,8 @@
('sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg))
or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10')
fail_msg: out={{out}}
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen

@ -11,6 +11,11 @@
become_user: mitogen__pw_required
register: out
ignore_errors: true
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen
- assert:
that: |
@ -20,6 +25,11 @@
('password is required' in out.module_stderr)
)
fail_msg: out={{out}}
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen
- name: Ensure password sudo incorrect.
shell: whoami
@ -29,6 +39,11 @@
vars:
ansible_become_pass: nopes
ignore_errors: true
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen
- assert:
that: |
@ -37,6 +52,11 @@
('sudo password is incorrect' in out.msg)
)
fail_msg: out={{out}}
when:
# https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"]
or ansible_version.full is version("2.11", ">=", strict=True)
or is_mitogen
# TODO: https://github.com/dw/mitogen/issues/692
# - name: Ensure password sudo succeeds.

@ -1,7 +1,18 @@
- name: Report runtime settings
hosts: localhost
gather_facts: false
hosts: localhost:test-targets
gather_facts: true
tasks:
- debug: {var: ansible_facts.distribution}
- debug: {var: ansible_facts.distribution_major_version}
- debug: {var: ansible_facts.distribution_release}
- debug: {var: ansible_facts.distribution_version}
- debug: {var: ansible_facts.kernel}
- debug: {var: ansible_facts.kernel_version}
- debug: {var: ansible_facts.os_family}
- debug: {var: ansible_facts.osrevision}
- debug: {var: ansible_facts.osversion}
- debug: {var: ansible_facts.python}
- debug: {var: ansible_facts.system}
- debug: {var: ansible_forks}
- debug: {var: ansible_run_tags}
- debug: {var: ansible_skip_tags}

Loading…
Cancel
Save