summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-15 07:16:42 (GMT)
committerRichard Maw <richard.maw@codethink.co.uk>2015-04-16 04:09:41 (GMT)
commitcca2fa2e1d1b4e412ddf09cd70fe5754312f9b78 (patch)
tree6bc06ff6a5d9c6a74189622f81c046ce8299027e
parent8de7d921a3f8b7375691a4fbcfcfa8a66c49226c (diff)
downloaddefinitions-baserock/openstack-in-baserock2.tar.gz
OpenStack: Split Cinder into config, db and lv setupbaserock/openstack-in-baserock2
Change-Id: Iae387e39c4a62ef608496d31c748493fa88ce3e1
-rw-r--r--clusters/openstack-installer.morph9
-rw-r--r--openstack-cinder.configure57
-rw-r--r--openstack/manifest10
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-api.service5
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-backup.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-config-setup.service11
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-db-setup.service13
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service12
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-lv-setup.service12
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-scheduler.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-cinder-volume.service3
-rw-r--r--openstack/usr/share/openstack/cinder-config.yml37
-rw-r--r--openstack/usr/share/openstack/cinder-db.yml60
-rw-r--r--openstack/usr/share/openstack/cinder-iscsi.yml15
-rw-r--r--openstack/usr/share/openstack/cinder-lvs.yml21
-rw-r--r--openstack/usr/share/openstack/cinder.yml153
16 files changed, 260 insertions, 164 deletions
diff --git a/clusters/openstack-installer.morph b/clusters/openstack-installer.morph
index 2f2cbd0..6020b50 100644
--- a/clusters/openstack-installer.morph
+++ b/clusters/openstack-installer.morph
@@ -65,6 +65,9 @@ systems:
NOVA_DB_USER: novaDB
NOVA_DB_PASSWORD: veryinsecure
NOVA_VIRT_TYPE: kvm
+ CINDER_ENABLE_CONTROLLER: False
+ CINDER_ENABLE_COMPUTE: False
+ CINDER_ENABLE_STORAGE: False
CINDER_SERVICE_USER: cinder
CINDER_SERVICE_PASSWORD: veryinsecure
CINDER_DB_USER: cinderDB
@@ -107,6 +110,9 @@ systems:
HOSTNAME: threenode-controller
MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.2
NOVA_VIRT_TYPE: kvm
+ CINDER_ENABLE_CONTROLLER: True
+ CINDER_ENABLE_COMPUTE: False
+ CINDER_ENABLE_STORAGE: False
CINDER_SERVICE_USER: cinder
CINDER_SERVICE_PASSWORD: veryinsecure
CINDER_DB_USER: cinderDB
@@ -140,6 +146,9 @@ systems:
HOSTNAME: threenode-compute
MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.3
NOVA_VIRT_TYPE: kvm
+ CINDER_ENABLE_CONTROLLER: False
+ CINDER_ENABLE_COMPUTE: True
+ CINDER_ENABLE_STORAGE: True
CINDER_SERVICE_USER: cinder
CINDER_SERVICE_PASSWORD: veryinsecure
CINDER_DB_USER: cinderDB
diff --git a/openstack-cinder.configure b/openstack-cinder.configure
index 0c15bd2..a971dc4 100644
--- a/openstack-cinder.configure
+++ b/openstack-cinder.configure
@@ -18,10 +18,10 @@ set -e
ROOT="$1"
-##########################################################################
-
-ln -sf "/usr/lib/systemd/system/openstack-cinder-setup.service" \
- "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-cinder-setup.service"
+enable(){
+ ln -sf "/usr/lib/systemd/system/$1.service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service"
+}
##########################################################################
# Check variables
@@ -59,6 +59,55 @@ if [ -z "$RABBITMQ_HOST" -o \
exit 1
fi
+# Check optional variables
+
+unnaceptable(){
+ eval echo Unexpected value \$$1 for $1 >&2
+ exit 1
+}
+
+check_bool(){
+ case "$(eval echo \"\$$1\")" in
+ True|'')
+ eval "$1=true"
+ ;;
+ False)
+ eval "$1=false"
+ ;;
+ *)
+ unnaceptable "$1"
+ ;;
+ esac
+}
+
+check_bool CINDER_ENABLE_CONTROLLER
+check_bool CINDER_ENABLE_COMPUTE
+check_bool CINDER_ENABLE_STORAGE
+
+######################################
+# Enable relevant openstack services #
+######################################
+
+if "$CINDER_ENABLE_COMPUTE" || "$CINDER_ENABLE_STORAGE"; then
+ enable openstack-cinder-iscsi-setup
+ enable target #target.service!
+ enable iscsid
+fi
+if "$CINDER_ENABLE_COMPUTE" || "$CINDER_ENABLE_CONTROLLER"; then
+ enable openstack-cinder-config-setup
+fi
+if "$CINDER_ENABLE_STORAGE"; then
+ enable openstack-cinder-lv-setup
+ enable lvm2-lvmetad
+ enable openstack-cinder-volume
+ enable openstack-cinder-backup
+ enable openstack-cinder-scheduler
+fi
+if "$CINDER_ENABLE_CONTROLLER"; then
+ enable openstack-cinder-db-setup
+ enable openstack-cinder-api
+fi
+
##########################################################################
# Generate configuration file
##########################################################################
diff --git a/openstack/manifest b/openstack/manifest
index 4657d21..2a97385 100644
--- a/openstack/manifest
+++ b/openstack/manifest
@@ -5,7 +5,10 @@
0040755 0 0 /usr/share/openstack
0100644 0 0 /usr/share/openstack/hosts
0040755 0 0 /usr/share/openstack/cinder
-0100644 0 0 /usr/share/openstack/cinder.yml
+0100644 0 0 /usr/share/openstack/cinder-config.yml
+0100644 0 0 /usr/share/openstack/cinder-db.yml
+0100644 0 0 /usr/share/openstack/cinder-iscsi.yml
+0100644 0 0 /usr/share/openstack/cinder-lvs.yml
0100644 0 0 /usr/share/openstack/cinder/cinder.conf
0100644 0 0 /usr/share/openstack/cinder/api-paste.ini
0100644 0 0 /usr/share/openstack/cinder/policy.json
@@ -143,7 +146,10 @@
0100644 0 0 /usr/lib/systemd/system/openstack-nova-cert.service
0100644 0 0 /usr/lib/systemd/system/openstack-nova-serialproxy.service
0100644 0 0 /usr/lib/systemd/system/rabbitmq-server.service
-0100644 0 0 /usr/lib/systemd/system/openstack-cinder-setup.service
+0100644 0 0 /usr/lib/systemd/system/openstack-cinder-config-setup.service
+0100644 0 0 /usr/lib/systemd/system/openstack-cinder-db-setup.service
+0100644 0 0 /usr/lib/systemd/system/openstack-cinder-iscsi-setup.service
+0100644 0 0 /usr/lib/systemd/system/openstack-cinder-lv-setup.service
0100644 0 0 /usr/lib/systemd/system/openstack-cinder-api.service
0100644 0 0 /usr/lib/systemd/system/openstack-cinder-scheduler.service
0100644 0 0 /usr/lib/systemd/system/openstack-cinder-volume.service
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-api.service b/openstack/usr/lib/systemd/system/openstack-cinder-api.service
index c863f3f..d1aaf13 100644
--- a/openstack/usr/lib/systemd/system/openstack-cinder-api.service
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-api.service
@@ -1,7 +1,8 @@
[Unit]
Description=OpenStack Volume Service (code-named Cinder) API server
-After=syslog.target network-online.target
-Wants=network-online.target
+ConditionPathExists=/etc/cinder/cinder.conf
+After=postgres-server.service network-online.target openstack-cinder-db-setup.service openstack-cinder-config-setup.service
+Wants=postgres-server.service network-online.target
[Service]
Type=simple
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-backup.service b/openstack/usr/lib/systemd/system/openstack-cinder-backup.service
index 2f48922..bfb28b6 100644
--- a/openstack/usr/lib/systemd/system/openstack-cinder-backup.service
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-backup.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Cinder backup server
-After=syslog.target network-online.target
+ConditionPathExists=/etc/cinder/cinder.conf
+After=network-online.target openstack-cinder-volume.service openstack-cinder-config-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-config-setup.service b/openstack/usr/lib/systemd/system/openstack-cinder-config-setup.service
new file mode 100644
index 0000000..1c96693
--- /dev/null
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-config-setup.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Run cinder-config-setup Ansible scripts
+ConditionPathExists=/etc/openstack/cinder.conf
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/cinder-config.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-db-setup.service b/openstack/usr/lib/systemd/system/openstack-cinder-db-setup.service
new file mode 100644
index 0000000..01a352e
--- /dev/null
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-db-setup.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Run cinder-db-setup Ansible scripts
+ConditionPathExists=/etc/cinder/cinder.conf
+After=postgres-server.service openstack-cinder-config-setup.service openstack-keystone.service openstack-keystone-setup.service
+Wants=postgres-server.service openstack-cinder-config-setup.service openstack-keystone.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/cinder-db.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service b/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service
new file mode 100644
index 0000000..157f30f
--- /dev/null
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-iscsi-setup.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Run cinder-iscsi-setup Ansible scripts
+Before=iscsid.service target.service
+Wants= iscsid.service target.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/cinder-iscsi.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-lv-setup.service b/openstack/usr/lib/systemd/system/openstack-cinder-lv-setup.service
new file mode 100644
index 0000000..82e9b08
--- /dev/null
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-lv-setup.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Run cinder-lvs-setup Ansible scripts
+ConditionPathExists=/etc/openstack/cinder.conf
+Wants=lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/cinder-lvs.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-scheduler.service b/openstack/usr/lib/systemd/system/openstack-cinder-scheduler.service
index 025f1f3..c5f3337 100644
--- a/openstack/usr/lib/systemd/system/openstack-cinder-scheduler.service
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-scheduler.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Cinder scheduler server
-After=syslog.target network-online.target
+ConditionPathExists=/etc/cinder/cinder.conf
+After=network-online.target openstack-cinder-volume.service openstack-cinder-config-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-cinder-volume.service b/openstack/usr/lib/systemd/system/openstack-cinder-volume.service
index 4a8da9c..72cb73f 100644
--- a/openstack/usr/lib/systemd/system/openstack-cinder-volume.service
+++ b/openstack/usr/lib/systemd/system/openstack-cinder-volume.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Cinder volume server
-After=syslog.target network-online.target
+ConditionPathExists=/etc/cinder/cinder.conf
+After=network-online.target openstack-cinder-lv-setup.service openstack-cinder-config-setup.service lvm2-lvmetad.service iscsid.service target.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/share/openstack/cinder-config.yml b/openstack/usr/share/openstack/cinder-config.yml
new file mode 100644
index 0000000..7ca6ff3
--- /dev/null
+++ b/openstack/usr/share/openstack/cinder-config.yml
@@ -0,0 +1,37 @@
+---
+- hosts: localhost
+ vars_files:
+ - "/etc/openstack/cinder.conf"
+ tasks:
+# Configure cinder
+ - name: Create the cinder user.
+ user:
+ name: cinder
+ comment: Openstack Cinder Daemons
+ shell: /sbin/nologin
+ home: /var/lib/cinder
+
+ - name: Create the /var folders for cinder
+ file:
+ path: "{{ item }}"
+ state: directory
+ owner: cinder
+ group: cinder
+ with_items:
+ - /var/run/cinder
+ - /var/lock/cinder
+ - /var/log/cinder
+ - /var/lib/cinder
+ - /var/lib/cinder/volumer
+
+ - name: Create /etc/cinder directory
+ file:
+ path: /etc/cinder
+ state: directory
+
+ - name: Add the configuration needed for cinder in /etc/cinder using templates
+ template:
+ src: /usr/share/openstack/cinder/{{ item }}
+ dest: /etc/cinder/{{ item }}
+ with_lines:
+ - cd /usr/share/openstack/cinder && find -type f
diff --git a/openstack/usr/share/openstack/cinder-db.yml b/openstack/usr/share/openstack/cinder-db.yml
new file mode 100644
index 0000000..2a21172
--- /dev/null
+++ b/openstack/usr/share/openstack/cinder-db.yml
@@ -0,0 +1,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
diff --git a/openstack/usr/share/openstack/cinder-iscsi.yml b/openstack/usr/share/openstack/cinder-iscsi.yml
new file mode 100644
index 0000000..b80377a
--- /dev/null
+++ b/openstack/usr/share/openstack/cinder-iscsi.yml
@@ -0,0 +1,15 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Update kernel module dependencies
+ command: depmod -a
+
+ - name: generate InitiatorName for iscsi
+ shell: iscsi-iname
+ register: initiator_name
+
+ - lineinfile:
+ dest: /etc/iscsi/initiatorname.iscsi
+ regexp: '^InitiatorName=$'
+ line: 'InitiatorName={{ initiator_name.stdout }}'
+ backrefs: yes
diff --git a/openstack/usr/share/openstack/cinder-lvs.yml b/openstack/usr/share/openstack/cinder-lvs.yml
new file mode 100644
index 0000000..7a91a30
--- /dev/null
+++ b/openstack/usr/share/openstack/cinder-lvs.yml
@@ -0,0 +1,21 @@
+---
+- hosts: localhost
+ vars_files:
+ - "/etc/openstack/cinder.conf"
+ tasks:
+ - name: Check that CINDER_DEVICE exists
+ stat:
+ path: "{{ CINDER_DEVICE }}"
+ register: cinder_device_stats
+ failed_when: cinder_device_stats.stat.exists == false
+
+ - name: Configure LVM group for cinder
+ lvg:
+ vg: cinder-volumes
+ pvs: "{{ CINDER_DEVICE }}"
+
+ - lineinfile:
+ dest: /etc/lvm/lvm.conf
+ regexp: '# filter = \[ \"a\/\.\*/\" \]'
+ line: ' filter = [ "a|{{ CINDER_DEVICE }}|", "r/.*/" ]'
+ backrefs: yes
diff --git a/openstack/usr/share/openstack/cinder.yml b/openstack/usr/share/openstack/cinder.yml
deleted file mode 100644
index 2949084..0000000
--- a/openstack/usr/share/openstack/cinder.yml
+++ /dev/null
@@ -1,153 +0,0 @@
----
-- hosts: localhost
- vars_files:
- - "/etc/openstack/cinder.conf"
- tasks:
-
-# Configure iscsid, this can go in a separate script
- - name: Update kernel module dependencies
- command: depmod -a
-
- - name: generate InitiatorName for iscsi
- shell: iscsi-iname
- register: initiator_name
-
- - lineinfile:
- dest: /etc/iscsi/initiatorname.iscsi
- regexp: '^InitiatorName=$'
- line: 'InitiatorName={{ initiator_name.stdout }}'
- backrefs: yes
-
- - name: Enable and start iscsid
- service:
- name: "{{ item }}"
- enabled: yes
- state: started
- with_items:
- - iscsid
-
-# Configure LVM and target for Cinder
- - name: Check that CINDER_DEVICE exists
- stat:
- path: "{{ CINDER_DEVICE }}"
- register: cinder_device_stats
- failed_when: cinder_device_stats.stat.exists == false
-
- - name: Configure LVM group for cinder
- lvg:
- vg: cinder-volumes
- pvs: "{{ CINDER_DEVICE }}"
-
- - lineinfile:
- dest: /etc/lvm/lvm.conf
- regexp: '# filter = \[ \"a\/\.\*/\" \]'
- line: ' filter = [ "a|{{ CINDER_DEVICE }}|", "r/.*/" ]'
- backrefs: yes
-
- - name: Enable and start lvm2-lvmetad and target services
- service:
- name: "{{ item }}"
- enabled: yes
- state: started
- with_items:
- - lvm2-lvmetad
- - target
-
-# Configure cinder
- - name: Create the cinder user.
- user:
- name: cinder
- comment: Openstack Cinder Daemons
- shell: /sbin/nologin
- home: /var/lib/cinder
-
- - name: Create the /var folders for cinder
- file:
- path: "{{ item }}"
- state: directory
- owner: cinder
- group: cinder
- with_items:
- - /var/run/cinder
- - /var/lock/cinder
- - /var/log/cinder
- - /var/lib/cinder
- - /var/lib/cinder/volumer
-
- - name: Create /etc/cinder directory
- file:
- path: /etc/cinder
- state: directory
-
- - name: Add the configuration needed for cinder in /etc/cinder using templates
- template:
- src: /usr/share/openstack/cinder/{{ item }}
- dest: /etc/cinder/{{ item }}
- with_lines:
- - cd /usr/share/openstack/cinder && find -type f
-
- - 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 }}"
- 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
-
- - name: Enable and start openstack-cinder services
- service:
- name: "{{ item }}"
- enabled: yes
- state: started
- with_items:
- - openstack-cinder-api
- - openstack-cinder-scheduler
- - openstack-cinder-volume
- - openstack-cinder-backup