Skip to content

Instantly share code, notes, and snippets.

@danrough
Created August 4, 2014 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danrough/65ae1e4838b4256cf265 to your computer and use it in GitHub Desktop.
Save danrough/65ae1e4838b4256cf265 to your computer and use it in GitHub Desktop.
Create test environment using rax modules playbook
---
- name: Gather information from the inventory file about all hosts for later use
hosts: all
gather_facts: no
- name: Build test infrastructure
hosts: localhost
gather_facts: no
connection: local
tasks:
- name: Add internal network
rax_network: label=internal cidr=192.168.3.0/24 state=present region=LON
credentials=~/pyrax-uk.creds
register: network
- name: debug inventory file data
debug: var=hostvars[groups['load_balancer'][0]]['inventory_hostname']
- name: Gather information from test load balancer
rax_clb: name=london-load-balancer port=443 protocol=HTTPS algorithm=RANDOM
type=PUBLIC region=LON state=present wait=true
credentials=~/pyrax-uk.creds
register: lb
- name: debug lb data
debug: var=lb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment