Commit a3c33324 authored by Chris's avatar Chris
Browse files

Adding the ability to install additional prerequisites

parent ed2e0bea
......@@ -3,6 +3,9 @@
# If blank or undefined, the hostname will not be changed
hostname:
# Required packages to support the role tasks
required_utils: []
# Common packages and utils
common_utils:
- curl
......
......@@ -5,11 +5,32 @@
failed_when: false
register: result
- block:
- name: Install Python
raw: >
(test -e /etc/redhat-release && yum install -y python)
|| (test -e /etc/debian_version && apt-get -y update && apt-get install -y python)
- name: Install Python
raw: >
(test -e /etc/redhat-release && yum install -y python)
|| (test -e /etc/debian_version && apt-get -y update && apt-get install -y python)
when: result.rc == 1
- name: Gather facts to determine host OS
setup:
gather_subset: min
- name: Gather OS specific vars
include_vars: '{{ item }}'
with_first_found:
- vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml
- vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_release | lower }}.yml
- vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml
- vars/{{ ansible_distribution | lower }}.yml
- vars/{{ ansible_os_family | lower }}.yml
- defaults/main.yml
- include_tasks: '{{ item }}'
with_first_found:
- tasks/bootstrap_{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml
- tasks/bootstrap_{{ ansible_distribution | lower }}-{{ ansible_distribution_release | lower }}.yml
- tasks/bootstrap_{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml
- tasks/bootstrap_{{ ansible_distribution | lower }}.yml
- tasks/bootstrap_{{ ansible_os_family | lower }}.yml
...
# vi: set ts=2 sts=2 sw=2 et ft=yaml:
---
- name: Install additional OS specific required libraries
apt:
name: '{{ required_utils }}'
state: present
cache_valid_time: 3600
when: required_utils is defined and required_utils != None and required_utils | length
...
# vi: set ts=2 sts=2 sw=2 et ft=yaml:
---
- name: Install additional OS specific required libraries
dnf:
name: '{{ required_utils }}'
state: present
when: required_utils is defined and required_utils != None and required_utils | length
...
# vi: set ts=2 sts=2 sw=2 et ft=yaml:
---
- name: Install additional OS specific required libraries
yum:
name: '{{ required_utils }}'
state: present
update_cache: yes
when: required_utils is defined and required_utils != None and required_utils | length
...
# vi: set ts=2 sts=2 sw=2 et ft=yaml:
---
# This file overrides variables set in defaults/main.yml.
# Full documentation of the variables is available in that file.
required_utils:
- python-dnf
- libselinux-python
...
# vi: set ts=2 sts=2 sw=2 et ft=yaml:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment