forked from saikrishnaa/Ansible-Openstack-Queens-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlance.yml
70 lines (64 loc) · 3.33 KB
/
Glance.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
59
60
61
62
63
64
65
66
67
68
69
70
---
- name: login as controller
hosts: controller
remote_user: root
become: yes
tasks:
- name: install glance
apt:
name: glance
state: present
- name: update glance-api config file
ini_file:
path: /etc/glance/glance-api.conf
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- { section: "database", option: "connection", value: "mysql+pymysql://glance:root@controller/glance" }
- { section: "keystone_authtoken", option: "auth_uri", value: "http://controller:5000"}
- { section: "keystone_authtoken", option: "auth_url", value: "http://controller:5000"}
- { section: "keystone_authtoken", option: "memcached_servers", value: "controller:11211"}
- { section: "keystone_authtoken", option: "auth_type", value: "password"}
- { section: "keystone_authtoken", option: "project_domain_name", value: "Default"}
- { section: "keystone_authtoken", option: "user_domain_name", value: "Default"}
- { section: "keystone_authtoken", option: "project_name", value: "service"}
- { section: "keystone_authtoken", option: "username", value: "glance"}
- { section: "keystone_authtoken", option: "password", value: "root"}
- { section: "paste_deploy", option: "flavor", value: "keystone"}
- { section: "glance_store", option: "stores", value: "file,http"}
- { section: "glance_store", option: "default_store", value: "file"}
- { section: "glance_store", option: "filesystem_store_datadir", value: "/var/lib/glance/images/"}
- name: update glance-registryneutron-l3-agent config file
ini_file:
path: /etc/glance/glance-registry.conf
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- { section: "database", option: "connection", value: "mysql+pymysql://glance:root@controller/glance" }
- { section: "keystone_authtoken", option: "auth_uri", value: "http://controller:5000"}
- { section: "keystone_authtoken", option: "auth_url", value: "http://controller:5000"}
- { section: "keystone_authtoken", option: "memcached_servers", value: "controller:11211"}
- { section: "keystone_authtoken", option: "auth_type", value: "password"}
- { section: "keystone_authtoken", option: "project_domain_name", value: "Default"}
- { section: "keystone_authtoken", option: "user_domain_name", value: "Default"}
- { section: "keystone_authtoken", option: "project_name", value: "service"}
- { section: "keystone_authtoken", option: "username", value: "glance"}
- { section: "keystone_authtoken", option: "password", value: "root"}
- { section: "paste_deploy", option: "flavor", value: "keystone"}
- name: db sync glance
shell: su -s /bin/sh -c "glance-manage db_sync" glance
- name: glance services status
service: name={{item}} state=restarted
with_items:
- glance-registry
- glance-api
- name: install images
shell: "{{ item }}"
with_items:
# - ". /root/admin-openrc.sh"
# - "wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
- "sh glance-verification.sh"
- "openstack image create cirros --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public"
# - "openstack image list"