diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 93896a6c2..465391f6c 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -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" diff --git a/provisioning/tasks/config.yml b/provisioning/tasks/config.yml new file mode 100644 index 000000000..c7cf99bbe --- /dev/null +++ b/provisioning/tasks/config.yml @@ -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"