Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (36 sloc) 1.47 KB
---
# tasks file for init-for-integrated
# This tasks allowing you to arrange to organize groups in a playbooks dir.
#
# * About {group,host}_vars/**-secret.yml files.
# * These files encrypted that at Ansible-vault.
#
# Workaround:
# 2.1.1.0 で custom role path使ってると死亡 の回避
# 2.1.1.0 以上は以下の処理をする、それ以下はしない
# 実は >= "2.1.1.0" で判定可能だった(2.1.1.0 でテスト済)
#
# TODO: Change to best practices (http://docs.ansible.com/ansible/playbooks_best_practices.html#best-practices-for-variables-and-vaults)
- name: Ansible version check
command: ansible --version
register: ansible_version
delegate_to: 127.0.0.1
changed_when: False
- block:
- name: Read group_vars and host_vars. In addition, add the secret files.
include_vars: ../{{ item.group_or_host }}_vars/{{ item.type }}.yml
with_items:
- { group_or_host: 'group', type: 'all' }
- { group_or_host: 'host', type: "{{ inventory_hostname }}" }
- { group_or_host: 'host', type: "{{ inventory_hostname }}-secret" }
- include_vars: ../group_vars/{{ item }}.yml
with_items:
- "{{ lookup('items', '{{ group_names }}', wantlist=True) }}"
- include_vars: ../group_vars/{{ item }}-secret.yml
with_items:
- "{{ lookup('items', '{{ group_names }}', wantlist=True) }}"
when: ansible_version.full >= "2.1.1.0"
ignore_errors: True
- include: under_ver2.1.0.0.yml
static: no
when: ansible_version.full < "2.1.1.0"