Move platform specific vars

These will be ignored when not present
This commit is contained in:
Sonny Bakker 2021-01-30 10:26:43 +01:00
parent af7211830d
commit 0e5b42dcec

View file

@ -1,14 +1,11 @@
- hosts: localhost
pre_tasks:
- name: load OS specific vars
include_vars: '{{ item }}'
with_first_found:
- files:
- '{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml'
- '{{ ansible_distribution|lower }}.yml'
- '{{ ansible_os_family|lower }}.yml'
paths:
- 'vars/'
- name: install packages
become: true
package:
name: '{{ item }}'
state: present
loop: '{{ packages }}'
- name: add gitlab to known hosts
include_role:
name: common
@ -17,12 +14,6 @@
user: '{{ ansible_user_id }}'
items:
- { domain: '{{ gitlab_domain }}', key: '{{ gitlab_host_key }}' }
- name: install packages
become: true
package:
name: '{{ item }}'
state: present
loop: '{{ packages }}'
roles:
- common
- npm
@ -35,3 +26,6 @@
- import_tasks: 'tasks/coc.yml'
vars_files:
- 'vars/main.yml'
- 'vars/{{ ansible_os_family|lower }}.yml'
- 'vars/{{ ansible_distribution|lower }}.yml'
- 'vars/{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml'