add utils role
This commit is contained in:
10
roles/util/tasks/Ubuntu.yaml
Normal file
10
roles/util/tasks/Ubuntu.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: add vim ppa
|
||||
apt_repository:
|
||||
repo: ppa:jonathonf/vim
|
||||
state: "{{ util_vim_ppa_state }}"
|
||||
|
||||
- name: add git ppa
|
||||
apt_repository:
|
||||
repo: ppa:git-core/ppa
|
||||
state: "{{ util_git_ppa_state }}"
|
30
roles/util/tasks/main.yaml
Normal file
30
roles/util/tasks/main.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: gather os specific variables
|
||||
include_vars: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- vars
|
||||
|
||||
- name: include os specific tasks
|
||||
include_tasks: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- tasks
|
||||
|
||||
- name: install packages
|
||||
package:
|
||||
name: "{{ item.value }}"
|
||||
state: "{{ util_package_state }}"
|
||||
loop: "{{ (util_packages | default({})) | dict2items }}"
|
Reference in New Issue
Block a user