Dynamically work out which OS tasks to call

This commit is contained in:
Scott Wallace 2019-01-20 18:16:21 +00:00
parent 8fd3f96ced
commit 860b70aa87

View file

@ -1,15 +1,8 @@
- name: Linux desktop tasks
block:
- import_tasks: linux/software.yaml
- import_tasks: linux/config.yaml
when: ansible_system == 'Linux'
- name: OS X desktop tasks
block:
- import_tasks: darwin/homebrew.yaml
- import_tasks: darwin/mas.yaml
- import_tasks: darwin/prefs.yaml
when: ansible_system == 'Darwin'
- name: Desktop tasks
include_tasks: "{{ loop_task }}"
loop: "{{ query('fileglob', \"{{ ansible_system|lower }}/*\") }}"
loop_control:
loop_var: loop_task
- name: Common desktop tasks
import_tasks: firefox.yaml