Woojoong Kim | f000eda | 2017-10-20 15:00:43 -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 | --- |
Woojoong Kim | 1a1e370 | 2017-10-27 13:26:34 -0700 | [diff] [blame] | 16 | |
| 17 | - name: resolve sudo timeout |
| 18 | become: yes |
| 19 | shell: "echo 127.0.1.1 $(cat /etc/hostname) >> /etc/hosts" |
Woojoong Kim | f000eda | 2017-10-20 15:00:43 -0700 | [diff] [blame] | 20 | |
| 21 | - name: make interface config file |
Woojoong Kim | 1a1e370 | 2017-10-27 13:26:34 -0700 | [diff] [blame] | 22 | become: yes |
Woojoong Kim | f000eda | 2017-10-20 15:00:43 -0700 | [diff] [blame] | 23 | template: |
| 24 | src=interface.cfg.j2 |
Woojoong Kim | 1a1e370 | 2017-10-27 13:26:34 -0700 | [diff] [blame] | 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: assign results into each variable |
| 32 | set_fact: |
| 33 | date: "{{ tmp_date.stdout }}" |
Woojoong Kim | f000eda | 2017-10-20 15:00:43 -0700 | [diff] [blame] | 34 | |
| 35 | - name: make cp_config config file |
Woojoong Kim | 1a1e370 | 2017-10-27 13:26:34 -0700 | [diff] [blame] | 36 | become: yes |
Woojoong Kim | f000eda | 2017-10-20 15:00:43 -0700 | [diff] [blame] | 37 | template: |
| 38 | src=cp_config.cfg.j2 |
Woojoong Kim | 1a1e370 | 2017-10-27 13:26:34 -0700 | [diff] [blame] | 39 | dest="{{source_path}}/config/cp_config.cfg" owner=root group=root mode=755 |
| 40 | |
Woojoong Kim | e7d8772 | 2017-11-14 14:16:13 -0800 | [diff] [blame^] | 41 | - name: change CPU hexacode in run.sh file |
| 42 | become: yes |
| 43 | template: |
| 44 | src=run.sh.j2 |
| 45 | dest="{{source_path}}/cp/run.sh" owner=root group=root mode=755 |
| 46 | |
| 47 | - name: set hugepage parameter |
| 48 | become: yes |
| 49 | shell: "echo vm.nr_hugepages=512 >> /etc/sysctl.conf" |
| 50 | |
| 51 | - name: adjust changed hugepage parameter |
| 52 | become: yes |
| 53 | shell: "sysctl -p" |
| 54 | |
| 55 | - name: make run with log file |
| 56 | become: yes |
| 57 | template: |
| 58 | src=run_with_log.sh.j2 |
| 59 | dest="{{source_path}}/cp/run_with_log.sh" owner=root group=root mode=755 |
| 60 | |
| 61 | # Must wait until vSPGW-U successfully runs ngic dp software |
| 62 | # Must insert codes to wait until above |
| 63 | # Following codes will be uncommented when vSPGWU playbook is completed |
| 64 | #- name: wait until vSPGW-U runs successfully |
| 65 | # wait_for: |
| 66 | # timeout: 1800 |
| 67 | # path: "{{ source_path }}/cp/finish_vspgwu_flag" |
| 68 | # msg: Timeout to wait that vSPGWU runs successfully |
| 69 | |
| 70 | # This part should be run after user plane (data plane) runs in vSPGW-U |
| 71 | # If not, vSPGW-U and vSPGW-C will not be working well |
| 72 | - name: build and run vspgwc |
| 73 | become: yes |
| 74 | shell: "{{ item }}" |
| 75 | args: |
| 76 | chdir: "{{ source_path }}/cp" |
| 77 | environment: |
| 78 | NG_CORE: "{{ source_path }}" |
| 79 | RTE_SDK: "{{ source_path }}/dpdk" |
| 80 | RTE_TARGET: "x86_64-native-linuxapp-gcc" |
| 81 | HYPERSCANDIR: "/root/ngic/hyperscan-4.1.0" |
| 82 | with_items: |
| 83 | - make clean |
| 84 | - make |
| 85 | - ./run_with_log.sh |
| 86 | |
| 87 | - name: write flag |
| 88 | become: yes |
| 89 | shell: "echo 1 > {{source_path}}/cp/finish_flag" |