You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
---
|
|
|
|
- name: Write the inventory files for the included test cases
|
|
hosts: localhost
|
|
gather_facts: no
|
|
vars:
|
|
ansible_connection: local
|
|
tasks:
|
|
- set_fact:
|
|
threescale_inventory: '{{ lookup(''env'', ''THREESCALE_INVENTORY'')|b64decode|from_json }}'
|
|
when: 'threescale_inventory is not defined and lookup(''env'', ''THREESCALE_INVENTORY'')|length > 0'
|
|
|
|
- set_fact:
|
|
threescale_inventory: '{{ lookup(''file'', ''3scale-inventory.yaml'')|from_yaml }}'
|
|
when: 'threescale_inventory is not defined'
|
|
|
|
- name: Find the Jinja2 templates to process
|
|
find:
|
|
paths: '{{ playbook_dir }}'
|
|
patterns: '*.j2'
|
|
recurse: no
|
|
register: templates
|
|
|
|
- name: Select the target CI platform using the THREESCALE_POOL environment variable
|
|
set_fact:
|
|
threescale_inventory: '{{ threescale_inventory[env|int] }}'
|
|
vars:
|
|
env: '{{ lookup(''env'', ''THREESCALE_POOL'') }}'
|
|
|
|
- name: Process the Jinja2 templates
|
|
template:
|
|
src: '{{ item }}'
|
|
dest: '{{ item|replace(".j2", "") }}'
|
|
with_items: '{{ templates.files|json_query(''[*].path'') }}'
|
|
|