-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.yml
43 lines (38 loc) · 1.25 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- name: Octario-Infrared discover
hosts: localhost
connection: local
gather_facts: yes
any_errors_fatal: true
vars:
tester_directory: "{{ test.dir }}"
environment:
PATH: "{{ ansible_env.PATH }}"
VIRTUAL_ENV: "{{ ansible_env.VIRTUAL_ENV }}"
tasks:
- name: Add tester host to dynamic inventory
add_host:
name: "{{ test.tester.host }}"
group: tester
when: "'tester' in test and 'host' in test.tester"
- name: Add tester group to dynamic inventory
add_host:
name: "{{ test.tester.group }}"
group: tester:children
when: "'tester' in test and 'group' in test.tester"
- name: "Discover release version"
script: "ir-plugin/osp_version_name.py {{ tester_directory }}"
run_once: true
register: release_name
changed_when: false
- name: "Convert discovered component details into variables"
set_fact:
componentinfo="{{ release_name.stdout | from_json }}"
when:
release_name != 0
- name: Perform Octario execution
vars:
tester_type: "{{ test.t }}"
component: "{{ hostvars['localhost']['componentinfo'] }}"
include: "playbooks/{{ tester_type }}.yml"
tags:
- run