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