diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/cinder-volume')
8 files changed, 4 insertions, 62 deletions
diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh b/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh deleted file mode 100644 index 2e734188..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh +++ /dev/null @@ -1,3 +0,0 @@ -if [[ ! -f /var/cinder.img ]]; then - dd if=/dev/zero of=/var/cinder.img bs=1 count=0 seek=$1 -fi diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh b/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh deleted file mode 100644 index 55041c6e..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh +++ /dev/null @@ -1,6 +0,0 @@ -size=`df /var | awk '$3 ~ /[0-9]+/ { print $4 }'`; -if [[ $size -gt 2000000000 ]]; then - echo -n 2000000000000; -else - echo -n $((size * 1000 / 512 * 512)); -fi diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/loop.yml b/deploy/adapters/ansible/roles/cinder-volume/files/loop.yml deleted file mode 100644 index e872652a..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/files/loop.yml +++ /dev/null @@ -1 +0,0 @@ -physical_device: /dev/loop0 diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh b/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh deleted file mode 100644 index d0e6c776..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh +++ /dev/null @@ -1,7 +0,0 @@ -loop_dev=`losetup -a |grep "/var/cinder.img"|awk -F':' '{print $1}'` -if [[ -z $loop_dev ]]; then - losetup -f --show /var/cinder.img -else - echo $loop_dev -fi - diff --git a/deploy/adapters/ansible/roles/cinder-volume/tasks/loop.yml b/deploy/adapters/ansible/roles/cinder-volume/tasks/loop.yml deleted file mode 100644 index b44253c4..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/tasks/loop.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- include_vars: "{{ ansible_os_family }}.yml" - -- name: get available /var partition size - script: get_var_size.sh - register: part_size - -- name: create cinder file if not exitst - script: create_img.sh {{ part_size.stdout }} - -- name: do a losetup on /mnt/cinder-volumes - script: losetup.sh - register: loop_device - -- name: debug loop device - debug: msg={{ loop_device.stdout }} - -- name: create physical and group volumes - lvg: vg=cinder-volumes pvs={{ loop_device.stdout }} - vg_options=--force diff --git a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml index 6b193d6e..c0da9984 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml +++ b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml @@ -6,23 +6,13 @@ with_items: packages | union(packages_noarch) - name: generate cinder volume service list - shell: echo {{ item }} >> /opt/service + lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) -- name: check if physical device exists - stat: path={{ physical_device }} - register: status - -- name: load loop.yml - include: loop.yml - when: status.stat.exists == False or status.stat.isblk == False - -- name: load real.yml - include: real.yml - when: status.stat.exists == True and status.stat.isblk == True - - name: upload cinder-volume configuration template: src=cinder.conf dest=/etc/cinder/cinder.conf backup=yes notify: - restart cinder-volume services + +- meta: flush_handlers diff --git a/deploy/adapters/ansible/roles/cinder-volume/tasks/real.yml b/deploy/adapters/ansible/roles/cinder-volume/tasks/real.yml deleted file mode 100644 index 19ef828b..00000000 --- a/deploy/adapters/ansible/roles/cinder-volume/tasks/real.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- include_vars: "{{ ansible_os_family }}.yml" - -- name: destroy GPT lable - shell: dd if=/dev/urandom of={{ physical_device }} bs=4M count=1 - ignore_errors: True - -- name: create physical and group volumes - lvg: vg=cinder-volumes pvs={{ physical_device }} - vg_options=--force diff --git a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf index fdcac69d..4d8e49ce 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf +++ b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf @@ -3,7 +3,7 @@ rootwrap_config = /etc/cinder/rootwrap.conf api_paste_confg = /etc/cinder/api-paste.ini iscsi_helper = tgtadm volume_name_template = volume-%s -volume_group = cinder-volumes +volume_group = storage-volumes verbose = True auth_strategy = keystone state_path = /var/lib/cinder @@ -38,7 +38,6 @@ volume_name_template = volume-%s snapshot_name_template = snapshot-%s max_gigabytes=10000 -volume_group=cinder-volumes volume_clear=zero volume_clear_size=10 |