diff options
Diffstat (limited to 'compass/deploy/ansible/roles/glance/tasks')
4 files changed, 0 insertions, 114 deletions
diff --git a/compass/deploy/ansible/roles/glance/tasks/glance_config.yml b/compass/deploy/ansible/roles/glance/tasks/glance_config.yml deleted file mode 100644 index 28392a3..0000000 --- a/compass/deploy/ansible/roles/glance/tasks/glance_config.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: init glance db version - shell: glance-manage db_version_control 0 - -- name: sync glance db - shell: sleep 15; su -s /bin/sh -c "glance-manage db_sync" glance - register: result - until: result.rc == 0 - retries: 5 - delay: 3 - notify: - - restart glance-registry - - restart glance-api - -- meta: flush_handlers - -- name: place image upload script - template: src=image_upload.sh dest=/opt/image_upload.sh mode=0744 - -- name: download cirros image file - get_url: url={{ build_in_image }} dest=/opt/{{ build_in_image_name }} - -- name: wait for 9292 port to become available - wait_for: host={{ image_host }} port=9292 delay=5 - -- name: run image upload - shell: for i in {0..5}; do /opt/image_upload.sh && touch image_upload_completed; if [ $? != 0 ] ;then sleep 5; else break;fi;done - args: - creates: image_upload_completed diff --git a/compass/deploy/ansible/roles/glance/tasks/glance_install.yml b/compass/deploy/ansible/roles/glance/tasks/glance_install.yml deleted file mode 100644 index 505b3b0..0000000 --- a/compass/deploy/ansible/roles/glance/tasks/glance_install.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: install glance packages - apt: name={{ item }} state=latest force=yes - with_items: - - glance - - python-glanceclient - -- name: generate glance service list - shell: echo {{ item }} >> /opt/service - with_items: - - glance-registry - - glance-api - -- name: update glance conf - template: src={{ item }} dest=/etc/glance/{{ item }} - backup=yes - with_items: - - glance-api.conf - - glance-registry.conf - notify: - - restart glance-registry - - restart glance-api - -- name: remove default sqlite db - shell: rm /var/lib/glance/glance.sqlite || touch glance.sqllite.db.removed - diff --git a/compass/deploy/ansible/roles/glance/tasks/main.yml b/compass/deploy/ansible/roles/glance/tasks/main.yml deleted file mode 100644 index 296f0dc..0000000 --- a/compass/deploy/ansible/roles/glance/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- include: glance_install.yml - tags: - - install - - glance_install - - glance - -- include: nfs.yml - tags: - - nfs - -- include: glance_config.yml - when: HA_CLUSTER is not defined or HA_CLUSTER[inventory_hostname] == '' - tags: - - config - - glance_config - - glance - diff --git a/compass/deploy/ansible/roles/glance/tasks/nfs.yml b/compass/deploy/ansible/roles/glance/tasks/nfs.yml deleted file mode 100644 index c03ab4d..0000000 --- a/compass/deploy/ansible/roles/glance/tasks/nfs.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: get nfs server - local_action: shell /sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6| grep "10" -m 1 |awk '{print $2}'|tr -d "addr:" - register: ip_info - run_once: True - -- name: install nfs - local_action: yum name=nfs-utils state=present - run_once: True - -- name: create image directory - local_action: file path=/opt/images state=directory mode=0777 - run_once: True - -- name: update nfs config - local_action: lineinfile dest=/etc/exports state=present - regexp="/opt/images *(rw,insecure,sync,all_squash)" - line="/opt/images *(rw,insecure,sync,all_squash)" - run_once: True - -- name: restart nfs service - local_action: service name=nfs state=restarted enabled=yes - run_once: True - -- name: install nfs comm - apt: name=nfs-common state=present - -- name: get mount info - command: mount - register: mount_info - -- name: mount image directory - shell: | - mount -t nfs -onfsvers=3 {{ item }}:/opt/images /var/lib/glance/images - sed -i '/\/var\/lib\/glance\/images/d' /etc/fstab - echo {{ item }}:/opt/images /var/lib/glance/images/ nfs nfsvers=3 >> /etc/fstab - when: mount_info.stdout.find('images') == -1 - with_items: - ip_info.stdout_lines - retries: 5 - delay: 3 |