From 0e5b42dcec4d2104a931fcdf0ebad0048b18d640 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sat, 30 Jan 2021 10:26:43 +0100 Subject: [PATCH] Move platform specific vars These will be ignored when not present --- playbook.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/playbook.yml b/playbook.yml index 1fd2023..de85664 100644 --- a/playbook.yml +++ b/playbook.yml @@ -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'