Skip to content

Commit

Permalink
feat: implement os specific package logic
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs committed Apr 23, 2020
1 parent 1d64310 commit 2d69bfd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
16 changes: 16 additions & 0 deletions tasks/distro_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Bootstrap | Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
- "{{ ansible_os_family | lower }}.yml"

- name: Bootstrap | Install specific distro packages
package:
name: "{{ item }}"
state: present
with_items: "{{ distro_packages }}"
2 changes: 1 addition & 1 deletion tasks/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

- include_tasks: jq.yml

- include_tasks: socat.yml
- include_tasks: distro_packages.yml
when: ansible_os_family not in ["CoreOS", "Container Linux by CoreOS", "Coreos"]
5 changes: 0 additions & 5 deletions tasks/socat.yml

This file was deleted.

4 changes: 4 additions & 0 deletions vars/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
distro_packages:
- socat
- conntrack
4 changes: 4 additions & 0 deletions vars/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
distro_packages:
- socat
- conntrack

0 comments on commit 2d69bfd

Please sign in to comment.