summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/glance.yml
blob: 9533e5641210e116800d8fe65a5f222d02b9cce5 (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
---
- 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

  - 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={{ GLANCE_PUBLIC_URL }}
        internalurl={{ GLANCE_INTERNAL_URL | default('http://127.0.0.1:9292') }}
        adminurl={{ GLANCE_ADMIN_URL }}
        region='RegionOne'
        token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}

  - postgresql_user: name={{ GLANCE_DB_USER }}
    sudo: yes
    sudo_user: glance
  - postgresql_db: name=glance owner={{ GLANCE_DB_USER }}
    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