Skip to content

Instantly share code, notes, and snippets.

@coxley
Created November 17, 2015 21:22
Show Gist options
  • Select an option

  • Save coxley/cca659d1bb03944ceec8 to your computer and use it in GitHub Desktop.

Select an option

Save coxley/cca659d1bb03944ceec8 to your computer and use it in GitHub Desktop.
-d tasks/main.yml
---
- include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "main.yml"
- name: packages | Install system packages
become: true
package: >
name={{ item.key }}
state={{ item.state | default('present') }}
use={{ item.use | default(omit) }}
vars:
system_combined: "{{ {}|combine(system.archival, system.development, system.files, system.monitor, system.network) }}"
with_dict: system_combined
- name: packages | Install python packages
pip: >
name={{ item.key }}
executable={{ item.executable | default(omit) }}
state={{ item.state | default('present') }}
version={{ item.version | default(omit) }}
with_dict: python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment