"Fossies" - the Fresh Open Source Software Archive

Member "ansible-2.9.27/test/integration/targets/iso_extract/tasks/7zip.yml" (11 Oct 2021, 2137 Bytes) of package /linux/misc/ansible-2.9.27.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # Test code for the iso_extract module.
    2 # (c) 2017, James Tanner <tanner.jc@gmail.com>
    3 # (c) 2017, Dag Wieers <dag@wieers.com>
    4 
    5 # This file is part of Ansible
    6 #
    7 # Ansible is free software: you can redistribute it and/or modify
    8 # it under the terms of the GNU General Public License as published by
    9 # the Free Software Foundation, either version 3 of the License, or
   10 # (at your option) any later version.
   11 #
   12 # Ansible is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details.
   16 #
   17 # You should have received a copy of the GNU General Public License
   18 # along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
   19 
   20 - name: Gather facts
   21   setup:
   22   become: yes
   23 
   24 - name: Include distribution specific variables
   25   include_vars: "{{ lookup('first_found', params) }}"
   26   vars:
   27     params:
   28       files:
   29         - "{{ ansible_facts.distribution }}.yml"
   30         - "{{ ansible_facts.os_family }}.yml"
   31         - default.yml
   32       paths:
   33         - "{{ role_path }}/vars"
   34 
   35 - name: "{{ ansible_facts.os_family | upper }} | Install 7zip package"
   36   action: "{{ ansible_facts.pkg_mgr }}"
   37   args:
   38     name: "{{ iso_extract_7zip_package }}"
   39     state: present
   40   when: ansible_facts.distribution != 'MacOSX'
   41 
   42 - name: macOS
   43   when: ansible_facts.distribution == 'MacOSX'
   44   block:
   45     - name: MACOS | Find brew binary
   46       command: which brew
   47       register: brew_which
   48       when: ansible_distribution in ['MacOSX']
   49 
   50     - name: MACOS | Get owner of brew binary
   51       stat:
   52         path: "{{ brew_which.stdout }}"
   53       register: brew_stat
   54       when: ansible_distribution in ['MacOSX']
   55 
   56     - name: MACOS | Install 7zip package
   57       homebrew:
   58         name: p7zip
   59         state: present
   60         update_homebrew: no
   61       become: yes
   62       become_user: "{{ brew_stat.stat.pw_name }}"
   63       # Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
   64       # proper solution can be found
   65       environment:
   66         HOMEBREW_NO_AUTO_UPDATE: True