cleaned up linting and added AAP on Code ready
This commit is contained in:
48
old-demo-repository/roles/install_demo/tasks/main.yml
Normal file
48
old-demo-repository/roles/install_demo/tasks/main.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: explicitly load vars under a subkey for reliable access
|
||||
include_tasks: load_vars.yml
|
||||
|
||||
- name: set facts from role vars
|
||||
set_fact:
|
||||
demo_list: "{{ job_template_definitions|dict2items|map(attribute='key')|list }}"
|
||||
full_demo_info: "{{ job_template_definitions|dict2items }}"
|
||||
|
||||
- name: provide info to terminal window
|
||||
debug:
|
||||
msg:
|
||||
- "install {{ demo }} on {{ my_tower_host }}"
|
||||
- "total demos: {{ demo_list | length }}"
|
||||
- "available demos are: {{ demo_list }}"
|
||||
|
||||
- name: make sure demo is a valid demo
|
||||
assert:
|
||||
that:
|
||||
- demo is defined
|
||||
- demo in demo_list or demo == "all"
|
||||
msg:
|
||||
- "demo must be defined and be one of: {{ demo_list }}"
|
||||
- "full list can be found on https://github.com/ansible/product-demos"
|
||||
|
||||
- name: setup public cloud credentials
|
||||
include_tasks: "{{item}}"
|
||||
with_first_found:
|
||||
- "{{role_path}}/tasks/{{public_cloud}}.yml"
|
||||
- "{{role_path}}/tasks/unsupported_cloud.yml"
|
||||
|
||||
- name: install all job templates
|
||||
include_tasks: job_template_loop.yml
|
||||
loop: "{{ full_demo_info }}"
|
||||
when: demo == "all"
|
||||
|
||||
- name: install single job template
|
||||
include_tasks: job_template.yml
|
||||
when:
|
||||
- demo != "all"
|
||||
- job_template_definitions[demo].workflow is not defined or not job_template_definitions[demo].workflow
|
||||
|
||||
- name: install single workflow
|
||||
include_tasks: workflow.yml
|
||||
when:
|
||||
- demo != "all"
|
||||
- job_template_definitions[demo].workflow is defined
|
||||
- job_template_definitions[demo].workflow
|
||||
Reference in New Issue
Block a user