diff options
Diffstat (limited to 'openstack/usr/share/openstack/glance.yml')
-rw-r--r-- | openstack/usr/share/openstack/glance.yml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/glance.yml b/openstack/usr/share/openstack/glance.yml new file mode 100644 index 00000000..3bf51471 --- /dev/null +++ b/openstack/usr/share/openstack/glance.yml @@ -0,0 +1,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 |