blob: 97327bc0806cd39b0c0a68596545fe2be710597e [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
David K. Bainbridge317e7d72016-05-11 08:31:44 -070016---
David K. Bainbridgef4181702016-06-17 14:44:03 -070017- name: Generate DPID
18 shell: ifconfig ma1 | grep HWaddr | awk '{ print "0x0000"$5 }' | sed s/://g
19 register: dpid
20 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070021
David K. Bainbridgef4181702016-06-17 14:44:03 -070022- name: Ensure ofdpa Config
23 set_fact:
24 switch_id: "{{ dpid.stdout }}"
25 controller_ip: "onos-fabric"
26
27- name: Verify Openflow Agent
Jonathan Hart1728fc82017-08-22 12:47:10 -070028 shell: which ofagentapp | wc -w
David K. Bainbridgef4181702016-06-17 14:44:03 -070029 register: ofdpa_exists
30 changed_when: false
David K. Bainbridge317e7d72016-05-11 08:31:44 -070031
32- name: Openflow Agent Version
Jonathan Hart1728fc82017-08-22 12:47:10 -070033 command: ofagentapp --version
David K. Bainbridge317e7d72016-05-11 08:31:44 -070034 register: ofdpa_version
35 changed_when: false
David K. Bainbridgef4181702016-06-17 14:44:03 -070036 when: ofdpa_exists.stdout != "0"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070037
Jonathan Hart1728fc82017-08-22 12:47:10 -070038# Note: This is the version number of OFDPA 3.0 EA4
Charles Chan4016b8f2017-01-04 11:11:23 -080039- name: Version 2.0.4.0 Openflow Agent
David K. Bainbridge317e7d72016-05-11 08:31:44 -070040 include: ofdpa.yml
Jonathan Hart1728fc82017-08-22 12:47:10 -070041 when: ofdpa_exists.stdout == "0" or ofdpa_version.stderr.find('version 2.0.4.0') == -1
David K. Bainbridge317e7d72016-05-11 08:31:44 -070042
43- name: Utilities Scripts
44 template:
David K. Bainbridgebd1aa672016-11-09 13:15:29 -080045 src: "{{ item }}"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070046 dest: /root
47 owner: root
48 group: root
David K. Bainbridge8b179042016-11-30 15:38:42 -080049 mode: "0755"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070050 with_items:
David K. Bainbridge317e7d72016-05-11 08:31:44 -070051 - killit
52 - connect
David K. Bainbridge317e7d72016-05-11 08:31:44 -070053 register: utils
54
Charles Chanaba1b562016-08-01 16:33:07 -070055- name: Authorize SSH Key
56 become: yes
57 authorized_key:
58 key={{ pub_ssh_key }}
59 user=root
60 state=present
61 register: sshkey
62