---
|
- hosts:
|
- localhost
|
- all
|
connection: local
|
gather_facts: no
|
tags: packer
|
tasks:
|
- name: stats env_vars.yml and (legacy) env_secret_vars.yml
|
stat:
|
path: configs/{{ env_type }}/{{ item }}
|
loop:
|
- env_vars.yml
|
- env_secret_vars.yml
|
register: rstat_varfiles
|
|
- name: Include vars files
|
include_vars:
|
file: "{{ item.stat.path }}"
|
when: item.stat.exists
|
loop: "{{ rstat_varfiles.results }}"
|
loop_control:
|
label: "{{ item._ansible_item_label | default(item) }}"
|
|
- name: Set output_dir for all hosts
|
set_fact:
|
output_dir: "{{ hostvars.localhost.output_dir }}"
|
when: hostvars.localhost.output_dir is defined
|