add support to generate a random host to run on
This commit is contained in:
24
pick-a-host.yml
Normal file
24
pick-a-host.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
- name: get random host to run on
|
||||||
|
hosts: all
|
||||||
|
connection: local
|
||||||
|
gather_facts: no
|
||||||
|
become: no
|
||||||
|
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Show Ansible play hosts
|
||||||
|
debug:
|
||||||
|
var: play_hosts
|
||||||
|
run_once : yes
|
||||||
|
delegate_to : localhost
|
||||||
|
|
||||||
|
|
||||||
|
- name: Pick a random host
|
||||||
|
debug:
|
||||||
|
msg: "ansible-playbook job-launch.yml -u root -e tower_provision_host={{ play_hosts | random }}"
|
||||||
|
run_once : yes
|
||||||
|
delegate_to : localhost
|
||||||
|
|
||||||
|
|
||||||
|
...
|
@ -1,8 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CONC="100"
|
CONC="200"
|
||||||
REQU="100"
|
REQU="200"
|
||||||
SLEEP_SECS="400"
|
|
||||||
|
|
||||||
BASE_URL="tower2.thezengarden.net"
|
BASE_URL="tower2.thezengarden.net"
|
||||||
AAP_JOB_ID="9"
|
AAP_JOB_ID="9"
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
tower_lab_hosts:
|
||||||
|
- lab-dev-1
|
||||||
|
- lab-dev-2
|
||||||
|
- lab-prod-1
|
||||||
|
- lab-prod-2
|
||||||
|
|
||||||
|
|
||||||
tower_launch_jobs:
|
tower_launch_jobs:
|
||||||
- name: inmem_test
|
- name: inmem_test
|
||||||
extra_vars:
|
extra_vars:
|
||||||
tower_provision_host : "{{ tower_provision_host | default('localhost') }}"
|
tower_provision_host : "{{ tower_provision_host | default(tower_lab_hosts | random) }}"
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Reference in New Issue
Block a user