52 lines
2.3 KiB
YAML
52 lines
2.3 KiB
YAML
---
|
|
- name: add tower project
|
|
tower_project:
|
|
name: "{{hostvars.localhost[demo].project.name}}"
|
|
description: "{{hostvars.localhost[demo].project.description}}"
|
|
organization: "{{hostvars.localhost[demo].project.organization}}"
|
|
scm_type: "{{hostvars.localhost[demo].project.scm_type}}"
|
|
scm_url: "{{hostvars.localhost[demo].project.scm_url}}"
|
|
tower_username: "{{my_tower_username}}"
|
|
tower_password: "{{my_tower_password}}"
|
|
tower_host: "{{my_tower_host}}"
|
|
validate_certs: no
|
|
|
|
- name: add single job template without survey
|
|
tower_job_template:
|
|
name: "{{hostvars.localhost[demo].name}}"
|
|
description: "{{hostvars.localhost[demo].description}}"
|
|
job_type: "{{hostvars.localhost[demo].job_type}}"
|
|
inventory: "{{hostvars.localhost[demo].inventory}}"
|
|
project: "{{hostvars.localhost[demo].project.name}}"
|
|
playbook: "{{hostvars.localhost[demo].playbook}}"
|
|
fact_caching_enabled: "{{hostvars.localhost[demo].fact_caching_enabled | default('no')}}"
|
|
credential: "{{hostvars.localhost[demo].credential}}"
|
|
survey_enabled: "{{hostvars.localhost[demo].survey_enabled}}"
|
|
tower_username: "{{my_tower_username}}"
|
|
tower_password: "{{my_tower_password}}"
|
|
tower_host: "{{my_tower_host}}"
|
|
validate_certs: no
|
|
when:
|
|
- workshop_type in hostvars.localhost[demo].workshop_type
|
|
- not hostvars.localhost[demo].survey_enabled
|
|
|
|
- name: add single job template with survey
|
|
tower_job_template:
|
|
name: "{{hostvars.localhost[demo].name}}"
|
|
description: "{{hostvars.localhost[demo].description}}"
|
|
job_type: "{{hostvars.localhost[demo].job_type}}"
|
|
inventory: "{{hostvars.localhost[demo].inventory}}"
|
|
project: "{{hostvars.localhost[demo].project.name}}"
|
|
playbook: "{{hostvars.localhost[demo].playbook}}"
|
|
fact_caching_enabled: "{{hostvars.localhost[demo].fact_caching_enabled | default('no')}}"
|
|
credential: "{{hostvars.localhost[demo].credential}}"
|
|
survey_enabled: "{{hostvars.localhost[demo].survey_enabled}}"
|
|
survey_spec: "{{hostvars.localhost[demo].survey_spec}}"
|
|
tower_username: "{{my_tower_username}}"
|
|
tower_password: "{{my_tower_password}}"
|
|
tower_host: "{{my_tower_host}}"
|
|
validate_certs: no
|
|
when:
|
|
- workshop_type in hostvars.localhost[demo].workshop_type
|
|
- hostvars.localhost[demo].survey_enabled
|