Advertisement
Guest User

Untitled

a guest
Jun 10th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. - name: Perform a cinder DB sync
  2. command: "{{ cinder_bin }}/cinder-manage db sync"
  3. become: yes
  4. become_user: "{{ cinder_system_user_name }}"
  5. changed_when: false
  6.  
  7. - name: Perform data migrations if necessary and all cinder services are up
  8. block:
  9.  
  10. - name: Check if all cinder services are up
  11. shell: "{{ cinder_bin }}/cinder-manage service list | /usr/bin/awk '{ if(NR>1) print $5 }' | /bin/egrep -vq ':-)'"
  12. register: failed_cinder_services
  13. ignore_errors: True
  14.  
  15. - name: Fail if any cinder service is down
  16. fail:
  17. msg: At least one cinder service is down. You need to fix this before re-running the playbook.
  18. when: failed_cinder_services.rc != 1
  19.  
  20. - name: Perform online data migrations
  21. command: "{{ cinder_bin }}/cinder-manage db online_data_migrations"
  22. register: data_migrations
  23. changed_when: false
  24.  
  25. become: yes
  26. become_user: "{{ cinder_system_user_name }}"
  27. when:
  28. - "(cinder_all_software_updated | default('no')) | bool"
  29. - "ansible_local['openstack_ansible']['cinder']['need_online_data_migrations'] | bool"
  30.  
  31. - name: Disable the online migrations requirement
  32. ini_file:
  33. dest: "/etc/ansible/facts.d/openstack_ansible.fact"
  34. section: cinder
  35. option: need_online_data_migrations
  36. value: False
  37. when:
  38. - not data_migrations is skipped
  39. - data_migrations is succeeded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement