diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-26 19:19:10 +0000 |
---|---|---|
committer | Richard Ipsum <richardipsum@fastmail.co.uk> | 2015-04-10 20:17:45 +0100 |
commit | b43ed07ebb9853909016a3d5451b6d53cde6a590 (patch) | |
tree | 32db24420409c7f16f25fea28c4419818a25b784 /openstack/usr/share/openstack/cinder.yml | |
parent | a112ea0391a4a34d8475388cdce02f754c44d621 (diff) | |
download | definitions-b43ed07ebb9853909016a3d5451b6d53cde6a590.tar.gz |
cinder: Move setup scripts to Ansible.
Also change systemd units and configure extension to match this change
Diffstat (limited to 'openstack/usr/share/openstack/cinder.yml')
-rw-r--r-- | openstack/usr/share/openstack/cinder.yml | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/cinder.yml b/openstack/usr/share/openstack/cinder.yml new file mode 100644 index 00000000..f5f9ddc8 --- /dev/null +++ b/openstack/usr/share/openstack/cinder.yml @@ -0,0 +1,75 @@ +--- +- hosts: localhost + vars_files: + - "/etc/openstack/cinder.conf" + tasks: + - 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 + + - 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) + + - keystone_user: > + user={{ CINDER_USER }} + password={{ CINDER_PASSWORD }} + tenant=service + token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }} + + - keystone_user: > + role=admin + user={{ CINDER_USER }} + tenant=service + token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }} + + - 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 }} + + - 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 }} + + - postgresql_user: name={{ CINDER_DB_USER }} + sudo: yes + sudo_user: cinder + - postgresql_db: name=cinder owner={{ CINDER_DB_USER }} + sudo: yes + sudo_user: cinder + + - 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 + + - lvg: vg=cinder-volumes pvs={{ CINDER_DEVICE }} |