From 123be856941f222fe81f46d2ddc88ecf25aceaf6 Mon Sep 17 00:00:00 2001 From: Josh Rusch Date: Sat, 28 Sep 2019 23:23:17 -0400 Subject: [PATCH] missing a package, move to var defined packages --- tasks/main.yml | 31 ++++++++++--------------------- vars/RedHat-6.yml | 4 ++++ vars/RedHat-7.yml | 4 ++++ vars/RedHat.yml | 4 ++++ 4 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 vars/RedHat-6.yml create mode 100644 vars/RedHat-7.yml create mode 100644 vars/RedHat.yml diff --git a/tasks/main.yml b/tasks/main.yml index f1bce49..10a5be9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,41 +1,30 @@ --- +- name: gather os specific variables + include_vars: "{{ item }}" + with_first_found: + - "{{ ansible_os_family }}-{{ ansible_distribution_major_version}}.yml" + - "{{ ansible_os_family }}.yml" + tags: vars + - name: configure yum repos include: repos.yml - name: install selinux fact dependency - yum: name=libselinux-python state=present + yum: name="{{ _common_libselinux }}" state=present tags: - selinux - packages - name: install selinux management dependency - yum: name=libsemanage-python state=present - when: ansible_distribution_major_version|int < 8 + yum: name="{{ _common_libsemanage }}" state=present tags: - selinux - packages -- name: install selinux management dependency - yum: name=python3-libselinux state=present - when: ansible_distribution_major_version|int > 7 - tags: - - selinux - - packages - -- name: ensure python crypto is installed - yum: - name: python2-cryptography - state: present - when: ansible_distribution_major_version|int < 8 - tags: - - hitch - - packages - - name: ensure python crypto is installed yum: - name: python3-cryptography + name: "{{ _common_cryptography }}" state: present - when: ansible_distribution_major_version|int > 7 tags: - hitch - packages diff --git a/vars/RedHat-6.yml b/vars/RedHat-6.yml new file mode 100644 index 0000000..46b2247 --- /dev/null +++ b/vars/RedHat-6.yml @@ -0,0 +1,4 @@ +--- +_common_libselinux: libselinux-python +_common_libsemanage: libsemanage-python +_common_cryptography: python2-cryptography diff --git a/vars/RedHat-7.yml b/vars/RedHat-7.yml new file mode 100644 index 0000000..46b2247 --- /dev/null +++ b/vars/RedHat-7.yml @@ -0,0 +1,4 @@ +--- +_common_libselinux: libselinux-python +_common_libsemanage: libsemanage-python +_common_cryptography: python2-cryptography diff --git a/vars/RedHat.yml b/vars/RedHat.yml new file mode 100644 index 0000000..429676b --- /dev/null +++ b/vars/RedHat.yml @@ -0,0 +1,4 @@ +--- +_common_libselinux: python3-libselinux +_common_libsemanage: python3-libsemanage +_common_cryptography: python3-cryptography