blob: 041f954f7afd8d7fdf8becbc201ba7ff64fcd49b [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
David K. Bainbridge317e7d72016-05-11 08:31:44 -070017---
David K. Bainbridgef4181702016-06-17 14:44:03 -070018- name: Generate DPID
19 shell: ifconfig ma1 | grep HWaddr | awk '{ print "0x0000"$5 }' | sed s/://g
20 register: dpid
21 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070022
David K. Bainbridgef4181702016-06-17 14:44:03 -070023- name: Ensure ofdpa Config
24 set_fact:
25 switch_id: "{{ dpid.stdout }}"
26 controller_ip: "onos-fabric"
27
28- name: Verify Openflow Agent
29 shell: which ofdpa | wc -w
30 register: ofdpa_exists
31 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070032
33- name: Openflow Agent Version
David K. Bainbridge17248c02016-08-29 17:04:34 -070034 command: ofdpa --version
David K. Bainbridge317e7d72016-05-11 08:31:44 -070035 register: ofdpa_version
36 changed_when: false
David K. Bainbridgef4181702016-06-17 14:44:03 -070037 when: ofdpa_exists.stdout != "0"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070038
Charles Chan4016b8f2017-01-04 11:11:23 -080039# Note: This is the version number of OFDPA 3.0 EA0
40- name: Version 2.0.4.0 Openflow Agent
David K. Bainbridge317e7d72016-05-11 08:31:44 -070041 include: ofdpa.yml
Charles Chan4016b8f2017-01-04 11:11:23 -080042 when: ofdpa_exists.stdout == "0" or ofdpa_version.stdout.find('version 2.0.4.0') == -1
David K. Bainbridge317e7d72016-05-11 08:31:44 -070043
44- name: Utilities Scripts
45 template:
David K. Bainbridgebd1aa672016-11-09 13:15:29 -080046 src: "{{ item }}"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070047 dest: /root
48 owner: root
49 group: root
David K. Bainbridge8b179042016-11-30 15:38:42 -080050 mode: "0755"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070051 with_items:
52 - purge
53 - killit
54 - connect
55 - reset
56 register: utils
57
Charles Chanaba1b562016-08-01 16:33:07 -070058- name: Authorize SSH Key
59 become: yes
60 authorized_key:
61 key={{ pub_ssh_key }}
62 user=root
63 state=present
64 register: sshkey
65