summaryrefslogtreecommitdiffstats
path: root/roles/glusterfs/tasks/migrate.yml
blob: 3ef7917659cea6a4cce3329190c7a4dd4bfa58c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- debug: msg="Migrating"

#- name: Detect if source host {{ glusterfs_migrate_from }} is failed or running
#  wait_for: host={{ glusterfs_migrate_from }} port=24007 timeout=1
#  register: srcres
#  changed_when: srcres | failed
#  failed_when: false

#- set_fact: 
#    glusterfs_migrate_failed: "{{ srcres | changed }}"

- set_fact: 
    glusterfs_migrate_failed: "1"

- name: Analyze current configuration
  include_tasks: iterate_domains.yml
  vars:
    action: "migrate_volume"
    migrate_action: "migrate_inform"
    migrate_from: "{{ glusterfs_migrate_from }}"
    migrate_to: "{{ glusterfs_migrate_to }}"
    migrate_failed: "{{ glusterfs_migrate_failed }}"

- name: Exterminate mankind
  pause: prompt='Please confirm if you want to proceed. Press Ctrl+c and then "a" to abort'

- name: Analyze current configuration
  include_tasks: iterate_domains.yml
  vars:
    action: "migrate_volume"
    migrate_action: "{{ migrate_failed | ternary('migrate_failed_brick', 'migrate_live_brick') }}"
    migrate_from: "{{ glusterfs_migrate_from }}"
    migrate_to: "{{ glusterfs_migrate_to }}"
    migrate_failed: "{{ glusterfs_migrate_failed }}"