blob: 3bf514715971aab0f1b6d2312f14924c3733cc06 (
plain)
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
|
---
- hosts: localhost
vars_files:
- "/etc/openstack/glance.conf"
tasks:
- name: Create the glance user.
user: name=glance comment="Openstack Glance Daemons" shell=/sbin/nologin home=/var/lib/glance
- name: Create the /var folders for glance
file: path={{ item }} state=directory owner=glance group=glance
with_items:
- /var/run/glance
- /var/lock/glance
- /var/log/glance
- /var/lib/glance
- /var/lib/glance/images
- /var/lib/glance/image-cache
- file: path=/etc/glance state=directory
- name: Add the configuration needed for glance in /etc/glance using templates
template: src=/usr/share/openstack/glance/{{ item }} dest=/etc/glance/{{ item }}
with_lines:
- (cd /usr/share/openstack/glance && find -type f)
- keystone_user: >
user={{ GLANCE_SERVICE_USER }}
password={{ GLANCE_SERVICE_PASSWORD }}
tenant=service
token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}
- keystone_user: >
role=admin
user={{ GLANCE_SERVICE_USER }}
tenant=service
token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}
- keystone_service: >
name=glance
type=image
description="Openstack Image Service"
publicurl=http://{{ CONTROLLER_HOST_ADDRESS }}:9292
internalurl=http://{{ CONTROLLER_HOST_ADDRESS }}:9292
adminurl=http://{{ CONTROLLER_HOST_ADDRESS }}:9292
region='regionOne'
token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}
- postgresql_user: name={{ GLANCE_DB_USER }} login_host={{ CONTROLLER_HOST_ADDRESS }} password={{ GLANCE_DB_PASSWORD }}
sudo: yes
sudo_user: glance
- postgresql_db: name=glance owner={{ GLANCE_DB_USER }} login_host={{ CONTROLLER_HOST_ADDRESS }}
sudo: yes
sudo_user: glance
- glance_manage: action=dbsync
sudo: yes
sudo_user: glance
- name: Enable and start openstack-glance service
service: name={{ item }} enabled=yes state=started
with_items:
- openstack-glance-api.service
- openstack-glance-registry.service
|