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-02-25 18:46:35 +0000 |
commit | 596bb56ab19b0c6be1b818e8cedd2798883050ca (patch) | |
tree | 44aebde27b510a99d97478bb4baef23d63f1cc22 /openstack/usr/share/openstack/glance.yml | |
parent | add981817e87735cfeb69177628c18669fb4126e (diff) | |
download | definitions-596bb56ab19b0c6be1b818e8cedd2798883050ca.tar.gz |
Glance configuration in ansible
Diffstat (limited to 'openstack/usr/share/openstack/glance.yml')
-rw-r--r-- | openstack/usr/share/openstack/glance.yml | 60 |
1 files changed, 60 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..9533e564 --- /dev/null +++ b/openstack/usr/share/openstack/glance.yml @@ -0,0 +1,60 @@ +--- +- 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 + + - 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 | default('http://127.0.0.1:9292') }} + adminurl={{ GLANCE_ADMIN_URL }} + region='RegionOne' + token={{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }} + + - postgresql_user: name={{ GLANCE_DB_USER }} + sudo: yes + sudo_user: glance + - postgresql_db: name=glance owner={{ GLANCE_DB_USER }} + 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 |