workflow test

This commit is contained in:
ipvsean
2020-03-10 12:28:40 -04:00
parent 3edd2cf161
commit e5447e6819
6 changed files with 118 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
---
- name: add tower project
tower_project:
name: "{{item.value.project.name}}"

View File

@@ -10,4 +10,13 @@
- name: install single job template
include: single_job_template.yml
when: demo != "all"
when:
- demo != "all"
- hostvars[inventory_hostname][demo].workflow is undefined or not hostvars[inventory_hostname][demo].workflow
- name: install single workflow
include: workflow.yml
when:
- demo != "all"
- hostvars[inventory_hostname][demo].workflow is defined
- hostvars[inventory_hostname][demo].workflow

View File

@@ -1,3 +1,4 @@
---
- name: add tower project
tower_project:
name: "{{hostvars.localhost[demo].project.name}}"
@@ -26,7 +27,7 @@
tower_host: "{{my_tower_host}}"
validate_certs: no
when:
- workshop_type in item.value.workshop_type
- workshop_type in hostvars.localhost[demo].workshop_type
- not hostvars.localhost[demo].survey_enabled
- name: add single job template with survey
@@ -46,5 +47,5 @@
tower_host: "{{my_tower_host}}"
validate_certs: no
when:
- workshop_type in item.value.workshop_type
- workshop_type in hostvars.localhost[demo].workshop_type
- hostvars.localhost[demo].survey_enabled

View File

@@ -0,0 +1,16 @@
---
#these tasks will install a workflow
- name: install all job templates in relation to workflow
include: add_job_template.yml
loop: "{{hostvars[inventory_hostname][demo].job_templates|dict2items}}"
- tower_workflow_template:
name: "{{hostvars[inventory_hostname][demo].name}}"
description: "{{hostvars[inventory_hostname][demo].description}}"
organization: "{{hostvars[inventory_hostname][demo].organization}}"
schema: "{{ hostvars[inventory_hostname][demo].schema}}"
tower_username: "{{my_tower_username}}"
tower_password: "{{my_tower_password}}"
tower_host: "{{my_tower_host}}"
validate_certs: no