David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame^] | 1 | --- |
| 2 | - name: Verify controller_ip Set |
| 3 | fail: msg="Please set variable 'controller_ip'. This can be set via a variable file or via the command line using the '--extra-vars' option." |
| 4 | when: controller_ip is not defined |
| 5 | |
| 6 | - name: Verify switch_id Set |
| 7 | fail: msg="Please set variable 'switch_id'. This can be set via a host specific variable file or via the command line using the '--extra-vars' option." |
| 8 | when: switch_id is not defined |
| 9 | |
| 10 | - name: Openflow Agent Version |
| 11 | shell: ofdpa --version |
| 12 | register: ofdpa_version |
| 13 | changed_when: false |
| 14 | |
| 15 | - name: Version I.12.1.1+1.1 Openflow Agent |
| 16 | include: ofdpa.yml |
| 17 | when: ofdpa_version.stdout.find('version I.12.1.1+1.1') == -1 |
| 18 | |
| 19 | - name: Utilities Scripts |
| 20 | template: |
| 21 | src: files/{{ item }} |
| 22 | dest: /root |
| 23 | owner: root |
| 24 | group: root |
| 25 | mode: 0755 |
| 26 | with_items: |
| 27 | - purge |
| 28 | - killit |
| 29 | - connect |
| 30 | - reset |
| 31 | register: utils |
| 32 | |
| 33 | - name: Mark Persistent |
| 34 | command: persist {{ item }} |
| 35 | with_items: |
| 36 | - purge |
| 37 | - killit |
| 38 | - connect |
| 39 | - reset |
| 40 | when: utils.changed |
| 41 | |
| 42 | - name: Persist |
| 43 | command: savepersist |
| 44 | when: utils.changed |
| 45 | failed_when: false |