blob: 9ec5283f643b362065972d218a3e1028af93ce46 [file] [log] [blame]
Sapan Bhatiad8e129a2014-11-19 15:26:11 -05001---
2- hosts: 127.0.0.1
Sapand3e96172014-12-03 01:27:56 -05003 connection: local
4 tasks:
Sapan Bhatiaba746bd2014-12-19 14:10:42 -05005 {% if not delete %}
Sapand3e96172014-12-03 01:27:56 -05006 - nova_keypair:
7 state: present
8 auth_url: {{ endpoint }}
9 login_username: {{ admin_user }}
10 login_password: {{ admin_password }}
11 login_tenant_name: {{ admin_tenant }}
12 name: {{ key_name }}
13 public_key: "{{ key.public_key}}"
Sapan Bhatiaba746bd2014-12-19 14:10:42 -050014 {% endif %}
Sapand3e96172014-12-03 01:27:56 -050015 - nova_compute:
Sapand3e96172014-12-03 01:27:56 -050016 auth_url: {{ endpoint }}
17 login_username: {{ admin_user }}
18 login_password: {{ admin_password }}
19 login_tenant_name: {{ admin_tenant }}
Sapand3e96172014-12-03 01:27:56 -050020 name: {{ name }}
Sapan Bhatiaba746bd2014-12-19 14:10:42 -050021 {% if delete %}
22 state: absent
23 {% else %}
24 state: present
25 availability_zone: {{ availability_zone }}
Sapand3e96172014-12-03 01:27:56 -050026 image_id: {{ image_id }}
27 key_name: {{ key_name }}
28 wait_for: 200
29 flavor_id: {{ flavor_id }}
30 user_data: "{{ user_data }}"
31 nics:
32 {% for net in nics %}
33 - net-id: {{ net }}
34 {% endfor %}
Sapan28b9c432014-12-03 00:03:56 -050035
Sapand3e96172014-12-03 01:27:56 -050036 {% if meta %}
37 meta:
38 {% for k,v in meta.items() %}
39 {{ k }} : "{{ v }}"
40 {% endfor %}
41 {% endif %}
Sapan Bhatiaba746bd2014-12-19 14:10:42 -050042 {% else %}
43 state: present
44 image_id: {{ image_id }}
45 key_name: {{ key_name }}
46 wait_for: 200
47 flavor_id: {{ flavor_id }}
48 user_data: "{{ user_data }}"
49 nics:
50 {% for net in nics %}
51 - net-id: {{ net }}
52 {% endfor %}
53
54 {% if meta %}
55 meta:
56 {% for k,v in meta.items() %}
57 {{ k }} : "{{ v }}"
58 {% endfor %}
59 {% endif %}
60 {% endif %}