blob: 6bbb9df3945d8d1e8e0071ac1619a7775112aa6c [file] [log] [blame]
David K. Bainbridge317e7d72016-05-11 08:31:44 -07001---
David K. Bainbridgef4181702016-06-17 14:44:03 -07002- name: Generate DPID
3 shell: ifconfig ma1 | grep HWaddr | awk '{ print "0x0000"$5 }' | sed s/://g
4 register: dpid
5 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -07006
David K. Bainbridgef4181702016-06-17 14:44:03 -07007- name: Ensure ofdpa Config
8 set_fact:
9 switch_id: "{{ dpid.stdout }}"
10 controller_ip: "onos-fabric"
11
12- name: Verify Openflow Agent
13 shell: which ofdpa | wc -w
14 register: ofdpa_exists
15 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070016
17- name: Openflow Agent Version
18 shell: ofdpa --version
19 register: ofdpa_version
20 changed_when: false
David K. Bainbridgef4181702016-06-17 14:44:03 -070021 when: ofdpa_exists.stdout != "0"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070022
23- name: Version I.12.1.1+1.1 Openflow Agent
24 include: ofdpa.yml
David K. Bainbridgef4181702016-06-17 14:44:03 -070025 when: ofdpa_exists.stdout == "0" or ofdpa_version.stdout.find('version I.12.1.1+1.1') == -1
David K. Bainbridge317e7d72016-05-11 08:31:44 -070026
27- name: Utilities Scripts
28 template:
29 src: files/{{ item }}
30 dest: /root
31 owner: root
32 group: root
33 mode: 0755
34 with_items:
35 - purge
36 - killit
37 - connect
38 - reset
39 register: utils
40
41- name: Mark Persistent
42 command: persist {{ item }}
43 with_items:
44 - purge
45 - killit
46 - connect
47 - reset
48 when: utils.changed
49
50- name: Persist
51 command: savepersist
52 when: utils.changed
53 failed_when: false