Woojoong Kim | f002aec | 2017-10-25 14:43:37 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | --- |
| 16 | |
| 17 | - name: resolve sudo timeout |
| 18 | become: yes |
| 19 | shell: "echo 127.0.1.1 $(cat /etc/hostname) >> /etc/hosts" |
| 20 | |
| 21 | - name: make interface config file |
| 22 | become: yes |
| 23 | template: |
| 24 | src=interface.cfg.j2 |
| 25 | dest="{{source_path}}/config/interface.cfg" owner=root group=root mode=755 |
| 26 | |
| 27 | - name: get date |
| 28 | shell: date +"%Y-%m-%d_%H-%M" |
| 29 | register: tmp_date |
| 30 | |
| 31 | - name: get port_0 value |
| 32 | shell: lspci -v -k | grep -i 'ethernet' | head -n 1 | tail -n 1 | awk '{print "0000:"$1}' |
| 33 | register: tmp_port_0 |
| 34 | |
| 35 | - name: get port_1 value |
| 36 | shell: lspci -v -k | grep -i 'ethernet' | head -n 2 | tail -n 1 | awk '{print "0000:"$1}' |
| 37 | register: tmp_port_1 |
| 38 | |
| 39 | - name: get s1u_mac value |
| 40 | shell: "ifconfig | grep -B 2 {{ s1u_ip }} | grep HWaddr | awk \'{print $5}\'" |
| 41 | register: tmp_s1u_mac |
| 42 | |
| 43 | - name: get sgi_mac value |
| 44 | shell: "ifconfig | grep -B 2 {{ sgi_ip }} | grep HWaddr | awk \'{print $5}\'" |
| 45 | register: tmp_sgi_mac |
| 46 | |
| 47 | - name: assign results into each variable |
| 48 | set_fact: |
| 49 | port_0: "{{ tmp_port_0.stdout }}" |
| 50 | port_1: "{{ tmp_port_1.stdout }}" |
| 51 | s1u_mac: "{{ tmp_s1u_mac.stdout }}" |
| 52 | sgi_mac: "{{ tmp_sgi_mac.stdout }}" |
| 53 | date: "{{ tmp_date.stdout }}" |
| 54 | |
| 55 | - name: make dp_config config file |
| 56 | become: yes |
| 57 | template: |
| 58 | src=dp_config.cfg.j2 |
| 59 | dest="{{source_path}}/config/dp_config.cfg" owner=root group=root mode=755 |
| 60 | |
| 61 | #- name: Build ngic |
| 62 | # become: yes |
| 63 | # shell: "{{ item }}" |
| 64 | # args: |
| 65 | # chdir: "{{ source_path }}" |
| 66 | # environment: |
| 67 | # NG_CORE: "{{ source_path }}" |
| 68 | # RTE_SDK: "{{ source_path }}/dpdk" |
| 69 | # RTE_TARGET: "x86_64-native-linuxapp-gcc" |
| 70 | # HYPERSCANDIR: "/root/ngic/hyperscan-4.1.0" |
| 71 | # with_items: |
| 72 | # - make |
| 73 | # - /root/ngic/dp/run.sh -c 1 |