blob: c1c0b37d8fb9be100682ec057e5845e489270a9e [file] [log] [blame]
David K. Bainbridge317e7d72016-05-11 08:31:44 -07001---
2- name: Openflow Agent Debian Archive
3 get_url:
4 url: http://github.com/ciena/ZeroTouchProvisioning/raw/master/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb
5 validate_certs: false
6 dest: /mnt/flash2/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb
7
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -07008- name: Verify Service Exists
9 stat:
10 path: /etc/init.d/ofdpa
11 register: ofdpa_stat
12 changed_when: false
13 failed_when: false
14
David K. Bainbridge317e7d72016-05-11 08:31:44 -070015- name: OpenFlow Agent Stopped
16 service: name=ofdpa state=stopped
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070017 when: ofdpa_stat.stat.exists
18
19- name: Verify Distributeion Release File
20 stat:
21 path: /etc/lsb-release
22 register: lsb_stat
23 changed_when: false
24 failed_when: false
25
26- name: Verify Distribute Name
27 shell: grep -i ubuntu /etc/lsb-release | wc -l
28 register: dist
29 changed_when: false
30 failed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070031
32- name: Openflow Agent
33 apt: deb="/mnt/flash2/ofdpa-i.12.1.1_12.1.1%2Baccton1.7-1_amd64.deb" force=true
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070034 when: not lsb_stat.stat.exists or dist.stdout == "0"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070035
36- name: OpenFlow Agent Started
37 service: name=ofdpa state=started
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070038 when: not lsb_stat.stat.exists or dist.stdout == "0"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070039
40- name: Mark Persist Openflow Agent
41 command: persist /etc/accton/ofdpa.conf
David K. Bainbridge17248c02016-08-29 17:04:34 -070042 changed_when: true
David K. Bainbridge317e7d72016-05-11 08:31:44 -070043
44- name: Persist Openflow Agent
45 command: savepersist
46 failed_when: false
David K. Bainbridge17248c02016-08-29 17:04:34 -070047 changed_when: true