-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.yml
59 lines (52 loc) · 1.69 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- hosts: all
sudo: True
vars_files:
- defaults/main.yml
vars:
cirros_url:
http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack_identity_demo_password: password
tasks:
- name: update admin.openrc from template
template:
src: templates/admin.openrc
dest: "{{ ansible_env.PWD }}/admin.openrc"
owner: "{{ ansible_ssh_user }}"
- name: create demo tenant
keystone_user:
endpoint: "{{ openstack_identity_admin_url }}"
token: "{{ openstack_identity_admin_token }}"
tenant: demo
tenant_description: "Demo Tenant"
- name: create demo user
keystone_user:
endpoint: "{{ openstack_identity_admin_url }}"
token: "{{ openstack_identity_admin_token }}"
tenant: demo
user: demo
password: "{{ openstack_identity_demo_password }}"
- name: associate _member_ role with demo user
keystone_user:
endpoint: "{{ openstack_identity_admin_url }}"
token: "{{ openstack_identity_admin_token }}"
tenant: demo
user: demo
role: _member_
- name: update demo.openrc from template
template:
src: templates/demo.openrc
dest: "{{ ansible_env.PWD }}/demo.openrc"
owner: "{{ ansible_ssh_user }}"
- name: ensure cirros image is registered
glance_image:
auth_url: "{{ openstack_identity_public_url }}"
login_tenant_name: demo
login_username: demo
login_password: "{{ openstack_identity_demo_password }}"
name: cirros
disk_format: qcow2
copy_from: "{{ cirros_url }}"
is_public: True
timeout: 1200
state: present