Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Move config load tasks to separate task file
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyc committed Apr 22, 2017
1 parent 5ad6e14 commit 3810705
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
18 changes: 1 addition & 17 deletions provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@
- ../default.config.yml

pre_tasks:
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
tags: ['always']

- name: Define config_dir.
set_fact:
config_dir: "{{ playbook_dir }}/.."
when: config_dir is not defined
tags: ['always']

- name: Include optional configuration files.
include_vars: "{{ item }}"
with_fileglob:
- "{{ config_dir }}/config.yml"
- "{{ config_dir }}/local.config.yml"
- "{{ config_dir }}/secrets.yml"
- "{{ config_dir }}/{{ lookup('env', 'DRUPALVM_ENV')|default(drupalvm_env, true)|default(ansible_env.DRUPALVM_ENV)|default(omit) }}.config.yml"
- include: tasks/config.yml
tags: ['always']

- include: "tasks/init-{{ ansible_os_family }}.yml"
Expand Down
16 changes: 16 additions & 0 deletions provisioning/tasks/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"

- name: Define config_dir.
set_fact:
config_dir: "{{ playbook_dir }}/.."
when: config_dir is not defined

- name: Include optional configuration files.
include_vars: "{{ item }}"
with_fileglob:
- "{{ config_dir }}/config.yml"
- "{{ config_dir }}/local.config.yml"
- "{{ config_dir }}/secrets.yml"
- "{{ config_dir }}/{{ lookup('env', 'DRUPALVM_ENV')|default(drupalvm_env, true)|default(ansible_env.DRUPALVM_ENV)|default(omit) }}.config.yml"

0 comments on commit 3810705

Please sign in to comment.