| 1 | --- |
| 2 | - name: Replication Session Operations |
| 3 | hosts: localhost |
| 4 | connection: local |
| 5 | vars: |
| 6 | unispherehost: '10.*.*.*' |
| 7 | validate_certs: false |
| 8 | username: 'admin' |
| 9 | password: '**' |
| 10 | session_id: "103079215195_APM00213404195_0000_103079215215_APM00213404195_0000" |
| 11 | session_name: "test-session" |
| 12 | |
| 13 | tasks: |
| 14 | - name: Get replication session details using name |
| 15 | replication_session: |
| 16 | unispherehost: "{{ unispherehost }}" |
| 17 | username: "{{ username }}" |
| 18 | password: "{{ password }}" |
| 19 | validate_certs: "{{ validate_certs }}" |
| 20 | session_name: "{{ session_name }}" |
| 21 | |
| 22 | - name: Get replication session details using ID |
| 23 | replication_session: |
| 24 | unispherehost: "{{ unispherehost }}" |
| 25 | username: "{{ username }}" |
| 26 | password: "{{ password }}" |
| 27 | validate_certs: "{{ validate_certs }}" |
| 28 | session_id: "{{ session_id }}" |
| 29 | |
| 30 | - name: Pause replication session |
| 31 | replication_session: |
| 32 | unispherehost: "{{ unispherehost }}" |
| 33 | username: "{{ username }}" |
| 34 | password: "{{ password }}" |
| 35 | validate_certs: "{{ validate_certs }}" |
| 36 | session_name: "{{ session_name }}" |
| 37 | pause: true |
| 38 | |
| 39 | - name: Pause replication session -- Idempotency |
| 40 | replication_session: |
| 41 | unispherehost: "{{ unispherehost }}" |
| 42 | username: "{{ username }}" |
| 43 | password: "{{ password }}" |
| 44 | validate_certs: "{{ validate_certs }}" |
| 45 | session_name: "{{ session_name }}" |
| 46 | pause: true |
| 47 | |
| 48 | - name: Resume replication session |
| 49 | replication_session: |
| 50 | unispherehost: "{{ unispherehost }}" |
| 51 | username: "{{ username }}" |
| 52 | password: "{{ password }}" |
| 53 | validate_certs: "{{ validate_certs }}" |
| 54 | session_name: "{{ session_name }}" |
| 55 | force_full_copy: true |
| 56 | pause: false |
| 57 | |
| 58 | - name: Resume replication session -- Idempotency |
| 59 | replication_session: |
| 60 | unispherehost: "{{ unispherehost }}" |
| 61 | username: "{{ username }}" |
| 62 | password: "{{ password }}" |
| 63 | validate_certs: "{{ validate_certs }}" |
| 64 | session_name: "{{ session_name }}" |
| 65 | force_full_copy: true |
| 66 | pause: false |
| 67 | |
| 68 | - name: Sync replication session |
| 69 | replication_session: |
| 70 | unispherehost: "{{ unispherehost }}" |
| 71 | username: "{{ username }}" |
| 72 | password: "{{ password }}" |
| 73 | validate_certs: "{{ validate_certs }}" |
| 74 | session_id: "{{ session_id }}" |
| 75 | sync: true |
| 76 | |
| 77 | - name: Failover replication session |
| 78 | replication_session: |
| 79 | unispherehost: "{{ unispherehost }}" |
| 80 | username: "{{ username }}" |
| 81 | password: "{{ password }}" |
| 82 | validate_certs: "{{ validate_certs }}" |
| 83 | session_name: "{{ session_name }}" |
| 84 | failover_with_sync: true |
| 85 | force: true |
| 86 | |
| 87 | - name: Failover replication session -- Idempotency |
| 88 | replication_session: |
| 89 | unispherehost: "{{ unispherehost }}" |
| 90 | username: "{{ username }}" |
| 91 | password: "{{ password }}" |
| 92 | validate_certs: "{{ validate_certs }}" |
| 93 | session_name: "{{ session_name }}" |
| 94 | failover_with_sync: true |
| 95 | force: true |
| 96 | |
| 97 | - name: Failback replication session |
| 98 | replication_session: |
| 99 | unispherehost: "{{ dest_unispherhost }}" |
| 100 | username: "{{ username }}" |
| 101 | password: "{{ password }}" |
| 102 | validate_certs: "{{ validate_certs }}" |
| 103 | session_name: "{{ session_name }}" |
| 104 | failback: true |
| 105 | force_full_copy: true |
| 106 | |
| 107 | - name: Failback replication session -- Idempotency |
| 108 | replication_session: |
| 109 | unispherehost: "{{ unispherehost }}" |
| 110 | username: "{{ username }}" |
| 111 | password: "{{ password }}" |
| 112 | validate_certs: "{{ validate_certs }}" |
| 113 | session_name: "{{ session_name }}" |
| 114 | failback: true |
| 115 | force_full_copy: true |
| 116 | |
| 117 | - name: Delete replication session |
| 118 | replication_session: |
| 119 | unispherehost: "{{ unispherehost }}" |
| 120 | username: "{{ username }}" |
| 121 | password: "{{ password }}" |
| 122 | validate_certs: "{{ validate_certs }}" |
| 123 | session_name: "test123" |
| 124 | state: "absent" |
| 125 | |
| 126 | - name: Delete replication session -- Idempotency |
| 127 | replication_session: |
| 128 | unispherehost: "{{ unispherehost }}" |
| 129 | username: "{{ username }}" |
| 130 | password: "{{ password }}" |
| 131 | validate_certs: "{{ validate_certs }}" |
| 132 | session_name: "test123" |
| 133 | state: "absent" |