Debian Codegraph @

test/integration/targets/setup_libxcrypt/tasks/uninstall.yml

raw
1 - name: Gather facts
2 setup:
3 gather_subset: [min]
4
5 - name: Uninstall libxcrypt on RedHat/CentOS/Fedora
6 when: ansible_facts.os_family == 'RedHat'
7 become: yes
8 package:
9 name: libxcrypt
10 state: absent
11
12 - name: Uninstall libxcrypt on Debian/Ubuntu
13 when: ansible_facts.os_family == 'Debian'
14 become: yes
15 package:
16 name: libcrypt1
17 state: absent
18
19 - name: Uninstall libxcrypt on macOS
20 when: ansible_facts.distribution == 'MacOSX'
21 block:
22 - name: MACOS | Find brew binary
23 command: which brew
24 register: brew_which
25
26 - name: MACOS | Get owner of brew binary
27 stat:
28 path: "{{ brew_which.stdout }}"
29 register: brew_stat
30
31 - name: MACOS | Uninstall libxcrypt
32 command: brew uninstall libxcrypt
33 become: yes
34 become_user: "{{ brew_stat.stat.pw_name }}"
35 vars:
36 # Avoid using the current interpreter, which may be from a venv that the become user has no access to.
37 ansible_python_interpreter: "{{ lookup('env', 'ANSIBLE_TEST_PYTHON_INTERPRETER') }}"
38 environment:
39 HOMEBREW_NO_AUTO_UPDATE: True