mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-19 23:33:37 -05:00
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
---
|
|
- name: Assure that default organization exists
|
|
organization:
|
|
name: Default
|
|
|
|
- name: HACK - delete orphaned projects from preload data where organization deletd
|
|
project:
|
|
name: "{{ item['id'] }}"
|
|
scm_type: git
|
|
state: absent
|
|
loop: >
|
|
{{ query('awx.awx.controller_api', 'projects',
|
|
query_params={'organization__isnull': true, 'name': 'Demo Project'})
|
|
}}
|
|
loop_control:
|
|
label: "Deleting Demo Project with null organization id={{ item['id'] }}"
|
|
|
|
- name: Assure that demo project exists
|
|
project:
|
|
name: "Demo Project"
|
|
scm_type: 'git'
|
|
scm_url: 'https://github.com/ansible/ansible-tower-samples'
|
|
scm_update_on_launch: true
|
|
organization: Default
|
|
|
|
- name: Assure that demo inventory exists
|
|
inventory:
|
|
name: "Demo Inventory"
|
|
organization: Default
|
|
|
|
- name: Create a Host
|
|
host:
|
|
name: "localhost"
|
|
inventory: "Demo Inventory"
|
|
state: present
|
|
variables:
|
|
ansible_connection: local
|
|
register: result
|
|
|
|
- name: Assure that demo job template exists
|
|
job_template:
|
|
name: "Demo Job Template"
|
|
project: "Demo Project"
|
|
inventory: "Demo Inventory"
|
|
playbook: "hello_world.yml"
|