Browse Source

provide an ansible playbook that prepares the test suite

pull/25/head
Nicolas Massé 8 years ago
parent
commit
a0826ff600
  1. 1
      tests/.meta/inventory
  2. 26
      tests/.meta/main.yml

1
tests/.meta/inventory

@ -0,0 +1 @@
localhost ansible_connection=local

26
tests/.meta/main.yml

@ -0,0 +1,26 @@
---
- name: Write the inventory files for the included test cases
hosts: localhost
gather_facts: no
tasks:
- set_fact:
threescale_inventory: '{{ lookup(''env'', ''THREESCALE_INVENTORY'')|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: 'inventory.j2'
recurse: yes
register: templates
- name: Process the Jinja2 templates
template:
src: '{{ item }}'
dest: '{{ item|replace(".j2", "") }}'
with_items: '{{ templates.files|json_query(''[*].path'') }}'
Loading…
Cancel
Save