add split-host-job-launch.yml test; various fixes and modifications
This commit is contained in:
@ -10,12 +10,7 @@
|
||||
|
||||
|
||||
vars:
|
||||
lab_tower_hosts:
|
||||
- lab-dev-1
|
||||
- lab-dev-2
|
||||
- lab-prod-1
|
||||
- lab-prod-2
|
||||
provision_host : "{{ tower_provision_host | default(lab_tower_hosts | random) }}"
|
||||
provision_host : "{{ tower_provision_host | default(ansible_play_hosts | random) }}"
|
||||
|
||||
|
||||
tasks:
|
||||
|
@ -3,8 +3,8 @@ lab-dev-1
|
||||
lab-dev-2
|
||||
lab-dev-3
|
||||
|
||||
[dev:vars]
|
||||
ansible_python_interpreter=/usr/bin/python2
|
||||
#[dev:vars]
|
||||
#ansible_python_interpreter=/usr/bin/python2
|
||||
|
||||
|
||||
[test]
|
||||
@ -12,8 +12,8 @@ lab-test-1
|
||||
lab-test-2
|
||||
lab-test-3
|
||||
|
||||
[test:vars]
|
||||
ansible_python_interpreter=/usr/bin/python3
|
||||
#[test:vars]
|
||||
#ansible_python_interpreter=/usr/bin/python3
|
||||
|
||||
|
||||
[prod]
|
||||
@ -21,8 +21,8 @@ lab-prod-1
|
||||
lab-prod-2
|
||||
lab-prod-3
|
||||
|
||||
[prod:vars]
|
||||
ansible_python_interpreter=/usr/bin/python3
|
||||
#[prod:vars]
|
||||
#ansible_python_interpreter=/usr/bin/python3
|
||||
|
||||
|
||||
[all:vars]
|
||||
|
31
split-host-job-launch.yml
Normal file
31
split-host-job-launch.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Split up hosts into single job runs
|
||||
hosts: all
|
||||
connection: local
|
||||
become: yes
|
||||
gather_facts: no
|
||||
|
||||
|
||||
vars_files:
|
||||
- vars/defaults.yml
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Launch job per each host
|
||||
no_log : "{{ __no_log | default('yes') }}"
|
||||
uri :
|
||||
url : "{{ tower_file_creation_url }}"
|
||||
force_basic_auth : yes
|
||||
user : "{{ tower_user }}"
|
||||
password : "{{ tower_password }}"
|
||||
body_format : json
|
||||
method : POST
|
||||
status_code : 201
|
||||
body:
|
||||
extra_vars:
|
||||
tower_provision_host: "{{ item }}"
|
||||
loop: "{{ ansible_play_hosts }}"
|
||||
run_once: yes
|
||||
|
||||
|
||||
...
|
0
utils/dev_tower_test.sh
Normal file → Executable file
0
utils/dev_tower_test.sh
Normal file → Executable file
0
utils/dev_tower_test_2.sh
Normal file → Executable file
0
utils/dev_tower_test_2.sh
Normal file → Executable file
@ -5,7 +5,7 @@ REQU="150"
|
||||
SLEEP_SECS="400"
|
||||
|
||||
BASE_URL="tower2.thezengarden.net"
|
||||
AAP_JOB_ID="26"
|
||||
AAP_JOB_ID="36"
|
||||
POST_PAYLOAD_PATH="empty.post"
|
||||
POST_PAYLOAD_TYPE="application/json"
|
||||
|
||||
|
@ -9,7 +9,7 @@ tower_url : 'https://tower2.thezengarden.net'
|
||||
tower_user : admin
|
||||
tower_password : redhat
|
||||
tower_file_removal_template : 13
|
||||
tower_file_creation_template : 12
|
||||
tower_file_creation_template : 44
|
||||
tower_file_remove_url : "{{ tower_url }}/api/v2/job_templates/\
|
||||
{{ tower_file_removal_template }}/launch/"
|
||||
tower_file_creation_url : "{{ tower_url }}/api/v2/job_templates/\
|
||||
|
Reference in New Issue
Block a user