Skip to content

Instantly share code, notes, and snippets.

@Apsu
Last active August 29, 2015 14:03
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 Apsu/703837618aeb88bfd07d to your computer and use it in GitHub Desktop.
Save Apsu/703837618aeb88bfd07d to your computer and use it in GitHub Desktop.
---
- copies:
cinder-blah: 0
neutron-agents: 6
- cidr: 10.0.0.0/24
- vip: 10.0.0.250
- infra_hosts:
- infra1:
ip: 10.0.0.1
- copies:
neutron-agents: 0
- infra2:
ip: 10.0.0.2
- infra3:
ip: 10.0.0.3
- compute_hosts:
- compute1:
ip: 10.0.0.4
- compute2:
ip: 10.0.0.5
- compute3:
ip: 10.0.0.6
- storage_hosts:
- cinder1:
ip: 10.0.0.10
- swift1:
ip: 10.0.0.20
{
// User specified
"all": {
"vars": {
"vip_address": "10.0.0.250"
}
},
"infra_hosts": {
"hosts": ["infra1", "infra2", "infra3"]
},
"compute_hosts": {
"hosts": ["compute1", "compute2"]
},
"storage_hosts": {
"hosts": ["cinder1", "swift1"]
},
// Dynamically generated
"hosts": {
"children": ["infra_hosts", "compute_hosts"]
},
"containers": {
"children": ["infra_containers", "compute_containers"]
},
"infra_containers": {
"children": ["glance-api"]
},
"glance-api": {
"hosts": ["infra1-glance-api-1234", "infra2-glance-api-5678"]
},
"compute_containers": {
"children": ["nova-all"]
},
"nova-all": {
"children": ["nova-compute", "nova-api-os-compute"]
},
"nova-compute": {
"hosts": ["compute1-nova-compute-1234", "compute2-nova-compute-5678"]
},
"neutron-all": {
"children": ["neutron-linuxbridge-agent", "neutron-agents"]
},
"neutron-linuxbridge-agent": {
"hosts": [
"compute1-nova-compute-1234",
"compute2-nova-compute-5678",
"infra1-neutron-agent-8972"
]
},
"_meta": {
"hostvars": {
// User specified
"infra1": {
"ansible_ssh_host": "10.0.0.1"
},
"infra2": {
"ansible_ssh_host": "10.0.0.2"
},
"infra3": {
"ansible_ssh_host": "10.0.0.3"
},
"compute1": {
"ansible_ssh_host": "10.0.0.4"
},
"compute2": {
"ansible_ssh_host": "10.0.0.5"
},
// Dynamically generated
"nova-compute.1234": {
"ansible_ssh_host": "1.2.3.4",
"container_name": "nova-compute"
}
}
}
}
---
- name: Build Infra Containers
host: infra_hosts
tasks:
- name: Build Containers
something: blah {{hostvars[item].ansible_ssh_host}}
with_items: group["infra_containers"]
- name: Build Compute Containers
host: compute_hosts
tasks:
- name: Build Containers
something: blah {{hostvars[item].ansible_ssh_host}}
with_items: group["compute_containers"]
- name: Provision Containers Common
host: containers
roles:
- common_container
- name: Provision Keystone
host: keystone-all
roles:
- keystone_common
- keystone_api
- name: Provision Keystone Setup
host: keystone-all[0]
roles:
- keystone_setup
- name: Provision Nova
host: nova-all
roles:
- nova_common
- name: Provision Nova Setup
host: nova-all[0]
roles:
- nova_setup
- nova_api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment