Skip to content

Instantly share code, notes, and snippets.

@etrikp
Created August 20, 2014 18:14
Show Gist options
  • Save etrikp/58ed29a86eacedccc7ea to your computer and use it in GitHub Desktop.
Save etrikp/58ed29a86eacedccc7ea to your computer and use it in GitHub Desktop.
# Creates a new VM and attaches to a network and passes metadata to the instance
# Needs a recent version of eventlet per https://bugs.launchpad.net/nova/+bug/1266974
---
- name: create nimbus instance
hosts: localhost
connection: local
gather_facts: False
tasks:
- name: launch openldap instance
nova_compute:
auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
state: "{{ os_instance_state }}"
login_username: "{{ lookup('env','OS_USERNAME') }}"
login_password: "{{ lookup('env','OS_PASSWORD') }}"
login_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}"
name: openldap
image_id: "{{ os_ubuntu_precise_image_id }}"
key_name: "{{ os_key_name }}"
wait_for: 200
flavor_id: "{{ os_flavor_id }}"
nics:
- net-id: 9b5e09f7-1be3-4d1a-a65b-4cca1433ca79
- net-id: fdce48ad-7707-4b53-8fc7-86d1cbf041cc
meta:
hostname: openldap
group: openldap,nimbus
user_data: "{{ os_user_data }}"
security_groups: "{{ os_security_group }}"
- name: launch idm service instance
nova_compute:
auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
state: "{{ os_instance_state }}"
login_username: "{{ lookup('env','OS_USERNAME') }}"
login_password: "{{ lookup('env','OS_PASSWORD') }}"
login_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}"
name: idmapi
image_id: "{{ os_ubuntu_precise_image_id }}"
key_name: "{{ os_key_name }}"
wait_for: 200
flavor_id: "{{ os_flavor_id }}"
nics:
- net-id: 9b5e09f7-1be3-4d1a-a65b-4cca1433ca79
- net-id: fdce48ad-7707-4b53-8fc7-86d1cbf041cc
meta:
hostname: idmapi
group: idmapi,nimbus
user_data: "{{ os_user_data }}"
security_groups: "{{ os_security_group }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment