Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/iso_extract/tasks/7zip.yml

raw
1 ---
2 # Test code for the iso_extract module.
3 # Copyright (c) 2017, James Tanner <[email protected]>
4 # Copyright (c) 2017, Dag Wieers <[email protected]>
5 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
6 # SPDX-License-Identifier: GPL-3.0-or-later
7
8 - name: Gather facts
9 setup:
10 become: true
11
12 - name: Include distribution specific variables
13 include_vars: "{{ lookup('first_found', params) }}"
14 vars:
15 params:
16 files:
17 - "{{ ansible_facts.distribution }}.yml"
18 - "{{ ansible_facts.os_family }}.yml"
19 - default.yml
20 paths:
21 - "{{ role_path }}/vars"
22
23 - name: "{{ ansible_facts.os_family | upper }} | Install 7zip package"
24 action: "{{ ansible_facts.pkg_mgr }}"
25 args:
26 name: "{{ iso_extract_7zip_package }}"
27 state: present
28 when: ansible_facts.distribution != 'MacOSX'
29
30 - name: macOS
31 when: ansible_facts.distribution == 'MacOSX'
32 block:
33 - name: MACOS | Find brew binary
34 command: which brew
35 register: brew_which
36 when: ansible_facts.distribution in ['MacOSX']
37
38 - name: MACOS | Get owner of brew binary
39 stat:
40 path: "{{ brew_which.stdout }}"
41 register: brew_stat
42 when: ansible_facts.distribution in ['MacOSX']
43
44 - name: MACOS | Install 7zip package
45 homebrew:
46 name: p7zip
47 state: present
48 update_homebrew: false
49 become: true
50 become_user: "{{ brew_stat.stat.pw_name }}"
51 # Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
52 # proper solution can be found
53 environment:
54 HOMEBREW_NO_AUTO_UPDATE: "True"