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 become_user: slartibartfast
ignore_errors: true ignore_errors: true
register: out 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. - name: Verify raw module output.
assert: assert:
@ -20,3 +25,8 @@
('sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg)) ('sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg))
or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10') or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10')
fail_msg: out={{out}} 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 become_user: mitogen__pw_required
register: out register: out
ignore_errors: true 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: - assert:
that: | that: |
@ -20,6 +25,11 @@
('password is required' in out.module_stderr) ('password is required' in out.module_stderr)
) )
fail_msg: out={{out}} 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. - name: Ensure password sudo incorrect.
shell: whoami shell: whoami
@ -29,6 +39,11 @@
vars: vars:
ansible_become_pass: nopes ansible_become_pass: nopes
ignore_errors: true 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: - assert:
that: | that: |
@ -37,6 +52,11 @@
('sudo password is incorrect' in out.msg) ('sudo password is incorrect' in out.msg)
) )
fail_msg: out={{out}} 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 # TODO: https://github.com/dw/mitogen/issues/692
# - name: Ensure password sudo succeeds. # - name: Ensure password sudo succeeds.

@ -1,7 +1,18 @@
- name: Report runtime settings - name: Report runtime settings
hosts: localhost hosts: localhost:test-targets
gather_facts: false gather_facts: true
tasks: 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_forks}
- debug: {var: ansible_run_tags} - debug: {var: ansible_run_tags}
- debug: {var: ansible_skip_tags} - debug: {var: ansible_skip_tags}

Loading…
Cancel
Save