summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/cinder-db.yml
blob: 2a21172031b82570801580edb68c73c7e9165e47 (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/cinder.conf"
  tasks:
  - name: Create cinder service user in service tenant
    keystone_user:
        user: "{{ CINDER_SERVICE_USER }}"
        password: "{{ CINDER_SERVICE_PASSWORD }}"
        tenant: service
        token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"

  - name: Assign admin role to cinder service user in the service tenant
    keystone_user:
        role: admin
        user: "{{ CINDER_SERVICE_USER }}"
        tenant: service
        token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"

  - name: Add cinder endpoint
    keystone_service:
        name: cinder
        type: volume
        description: Openstack Block Storage
        publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s'
        internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s'
        adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s'
        region: regionOne
        token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"

  - name: Add cinderv2 endpoint
    keystone_service:
        name: cinderv2
        type: volumev2
        description: Openstack Block Storage
        publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s'
        internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s'
        adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s'
        region: regionOne
        token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"

  - name: Create postgresql user for cinder
    postgresql_user:
        name: "{{ CINDER_DB_USER }}"
        password: "{{ CINDER_DB_PASSWORD }}"
    sudo: yes
    sudo_user: cinder

  - name: Create database for cinder services
    postgresql_db:
        name: cinder
        owner: "{{ CINDER_DB_USER }}"
    sudo: yes
    sudo_user: cinder

  - name: Initiate cinder database
    cinder_manage:
        action: dbsync
    sudo: yes
    sudo_user: cinder