@ -21,72 +21,46 @@
setup:
setup:
become : yes
become : yes
- name : Add EPEL repository
- name : Include distribution specific variables
yum_repository:
include_vars : "{{ lookup('first_found', params) }}"
name : epel
vars:
description : EPEL yum repo
params:
baseurl : https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
files:
state : present
- "{{ ansible_facts.distribution }}.yml"
when : ansible_distribution in ['CentOS']
- "{{ ansible_facts.os_family }}.yml"
- default.yml
- name : Install 7zip package if we are on Fedora
paths:
dnf:
- "{{ role_path }}/vars"
name : p7zip-plugins
state : installed
become : yes
when : ansible_distribution in ['Fedora']
- name : Install 7zip package if we are on CentOS
yum:
name : p7zip-plugins
state : installed
update_cache : yes
become : yes
when : ansible_distribution in ['CentOS']
- name : Install 7zip package if we are on OpenSUSE
zypper:
name : p7zip
state : installed
update_cache : yes
become : yes
when : ansible_distribution in ['openSUSE Leap']
- name : Install 7zip package if we are on Ubuntu
- name : "{{ ansible_facts.os_family | upper }} | Install 7zip package"
apt:
action : "{{ ansible_facts.pkg_mgr }}"
name : p7zip-full
args:
name : "{{ iso_extract_7zip_package }}"
state : present
state : present
update_cache : yes
when : ansible_facts.distribution != 'MacOSX'
become : yes
when : ansible_distribution in ['Ubuntu']
- name : Find brew binary
command : which brew
register : brew_which
when : ansible_distribution in ['MacOSX']
- name : Get owner of brew binary
- name : macOS
stat:
when : ansible_facts.distribution == 'MacOSX'
path : "{{ brew_which.stdout }}"
block:
register : brew_stat
- name : MACOS | Find brew binary
when : ansible_distribution in ['MacOSX']
command : which brew
register : brew_which
when : ansible_distribution in ['MacOSX']
- name : Install 7zip package if we are on MacOSX
- name : MACOS | Get owner of brew binary
homebrew:
stat:
name : p7zip
path : "{{ brew_which.stdout }}"
state : present
register : brew_stat
update_homebrew : no
when : ansible_distribution in ['MacOSX']
become : yes
become_user : "{{ brew_stat.stat.pw_name }}"
when : ansible_distribution in ['MacOSX']
# Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
# proper solution can be found
environment:
HOMEBREW_NO_AUTO_UPDATE : True
- name : Install 7zip package if we are on FreeBSD
- name : MACOS | Install 7zip package
pkgng:
homebrew:
name : p7zip
name : p7zip
state : present
state : present
become : yes
update_homebrew : no
when : ansible_distribution in ['FreeBSD']
become : yes
become_user : "{{ brew_stat.stat.pw_name }}"
# Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
# proper solution can be found
environment:
HOMEBREW_NO_AUTO_UPDATE : True