diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-02-20 14:20:49 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-16 17:30:38 +0000 |
commit | a06c0bf70386952e9440f0a726fd621760611fcd (patch) | |
tree | fd1fe916267abce6fa352072b652652f35516044 /openstack/usr/share/openstack/glance.yml | |
parent | a90c7414cd5b7697c07d8f2c60a796064ebd7f28 (diff) | |
download | definitions-a06c0bf70386952e9440f0a726fd621760611fcd.tar.gz |
Glance configuration in ansible
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..83d73428 --- /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={{ GLANCE_PUBLIC_URL }} + internalurl={{ GLANCE_INTERNAL_URL }} + adminurl={{ GLANCE_ADMIN_URL }} + region='RegionOne' + token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }} + + - postgresql_user: name={{ GLANCE_DB_USER }} login_host={{ CONTROLLER_HOST }} password={{ GLANCE_DB_PASSWORD }} + sudo: yes + sudo_user: glance + - postgresql_db: name=glance owner={{ GLANCE_DB_USER }} login_host={{ CONTROLLER_HOST }} + 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 |