According the qtip ci results, make these bugfixs.
1. skipping: no hosts matched
This used to work in Ansible 1.9.x with 127.0.0.1;But does not work in Asible 2.x
solved: add 127.0.0.1 as localhost in ./data/hosts
2. Using bare variables is deprecated.
solved: update playbook
3. use git module
4. To save time, turning Off Facts on localhost.
Since https://gerrit.opnfv.org/gerrit/#/c/20661/ is under codereview,
for qtip ci job, I temporarily modify function write_to_file() in
env_setup.py.
Change-Id: I71a08ebf87cd8c8d851a3f8f760e29e8725f0e0f
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
-
- hosts: "{{ roles }}"
tasks:
shell: rm -rf /usr/share/doc/phoronix-test-suite/
shell: rm -rf /usr/share/phoronix-test-suite
shell: rm -rf /root/photmp/
+
- name: cleaning results
file: path=/root/results state=absent
+
- name: make direc
file: path=/root/photmp/ state=directory
- - name: Fetch Phornonix
+
+ - name: Fetch Phornonix
shell: cd /root/photmp/ && wget https://www.dropbox.com/s/5kks513ozxy7vvs/phoronix-suite.tar.gz
+
- name: unarchive Phoronix
shell: cd /root/photmp/ && tar -zxvf phoronix-suite.tar.gz
+
- name: Install Phornonix Dependencies
shell: yum install php php-xml php-client php-process -y
+
- name: Install Phornonix
- shell: cd /root/photmp/phoronix-test-suite-master/&&./install-sh
+ shell: cd /root/photmp/phoronix-test-suite-master/&&./install-sh
+
- name: batchSetup
shell: phoronix-test-suite batch-setup
+
- name: install
shell: phoronix-test-suite batch-install cachebench
+
- name: run
- shell: phoronix-test-suite batch-run cachebench
+ shell: phoronix-test-suite batch-run cachebench
+
- name: making directory
file: path=/root/results state=directory
+
- name: copying result to temp directory
shell: cp -r /var/lib/phoronix-test-suite/test-results/* /root/results/
+
- name: registering files
shell: (cd /root/results/; find . -maxdepth 1 -type f) | cut -d'/' -f2
register: files_to_copy
+
- name: copy results
fetch: src=/root/results/{{item}} dest={{workingdir}}/{{Dest_dir}}/cachebench
- with_items: files_to_copy.stdout_lines
-
+ with_items: "{{files_to_copy.stdout_lines}}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making dhrystone directory
- file: path={{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp state=directory
+ file: path={{workingdir}}/{{Dest_dir}}/dhrystone state=directory
+
- name: making temporary dhrystone directory
file: path={{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- - name: checking_home directory
- shell: sudo echo $HOME
+ - name: checking home directory
+ shell: echo $HOME
register: home_dir
- name: cleaning tempT
shell: sudo rm -rf $HOME/tempT
- - name: cleaning_qtip_result
+ - name: cleaning qtip_result
shell: sudo rm -rf $HOME/qtip_result
- name: make directory
- include: ./git_proxy_pbook.yaml
- name: Clone unixbench
- shell: git clone https://github.com/kdlucas/byte-unixbench.git $HOME/tempT
+ git: repo=https://github.com/kdlucas/byte-unixbench.git
+ dest=$HOME/tempT
- name: make
shell: sudo make --directory $HOME/tempT/UnixBench/
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/log/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp
- with_items: copy_log_results.stdout_lines
+ with_items: "{{copy_log_results.stdout_lines}}"
- name: cleaning tempT
shell: sudo rm -rf $HOME/tempT
shell: sudo rm -rf $HOME/qtip_result
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dhrystone/)
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/dhrystone/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dhrystone/logs)
+
- name: removing dhrystone_temp
shell: rm -rf {{workingdir}}/{{Dest_dir}}/dhrystone/dhrystone_temp
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making dpi directory
file: path={{workingdir}}/{{Dest_dir}}/dpi state=directory
+
- name: making temporary whetstone directory
file: path={{workingdir}}/{{Dest_dir}}/dpi/dpi_temp state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- name: echo
shell: echo $USER
- - name: checking_home directory
+ - name: checking home directory
shell: echo $HOME
register: home_dir
- include: ./git_proxy_pbook.yaml
- name: Clone nDPI
- shell: cd $HOME/tempD && git clone https://github.com/ntop/nDPI.git
+ git: repo=https://github.com/ntop/nDPI.git
+ dest=$HOME/tempD
- name: autogen
shell: cd $HOME/tempD/nDPI && sudo ./autogen.sh
shell: cd $HOME/tempD/nDPI && sudo ./configure
- name: make
- shell: cd $HOME/tempD/nDPI && sudo make
+ shell: cd $HOME/tempD/nDPI && sudo make
- name: Fetching Test_pcap file
shell: cd $HOME/tempD/nDPI/example && wget http://artifacts.opnfv.org/qtip/utilities/test.pcap
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/dpi/dpi_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/dpi/dpi_temp
- with_items: copy_log_results.stdout_lines
+ with_items: "{{copy_log_results.stdout_lines}}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dpi/)
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/dpi/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/dpi/logs)
+
- name: removing dpi_temp
shell: rm -rf {{workingdir}}/{{Dest_dir}}/dpi/dpi_temp
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making fio directory
file: path={{workingdir}}/{{Dest_dir}}/fio state=directory
+
- name: making temporary fio directory
file: path={{workingdir}}/{{Dest_dir}}/fio/fio_temp state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- - name: checking_home directory
+ - name: checking home directory
shell: echo $HOME
register: home_dir
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/fio/fio_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/fio/fio_temp
- with_items: copy_log_results.stdout_lines
+ with_items: "{{copy_log_results.stdout_lines}}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/fio/fio_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/fio/)
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/fio/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/fio/fio_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/fio/logs)
+
- name: removing fio_log
shell: rm -rf {{workingdir}}/{{Dest_dir}}/fio/fio_temp
-
#git
- name: set git proxy(http)
shell: "git config --global http.proxy {{ http_proxy }}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
- tasks:
+ gather_facts: no
+ tasks:
- name: getting directory
shell: sudo echo $PWD
register: qtip_dir
+
- name: making Iperf directory
file: path={{workingdir}}/{{Dest_dir}}/iperf state=directory
+
- name: making temporary iperf directory
file: path={{workingdir}}/{{Dest_dir}}/iperf/iperf_temp state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- name: Rolename
set_fact:
- name: echo
shell: echo index_var
- - name: checking_home directory
+ - name: checking home directory
shell: echo $HOME
register: home_dir
- name: making Iperf temporary directory
shell: sudo mkdir $HOME/iperf
- - name: making results temporary directory
+ - name: making results temporary directory
shell: sudo mkdir $HOME/qtip_result
- include: ./sys_proxy_pbook.yaml
when: rolename =="2-host" and "{{ip2}}" == ''
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: Rolename
set_fact:
rolename: "{{role}}"
when: role is defined
+
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/iperf/iperf_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/iperf/)
when: rolename == "2-host"
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/iperf/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/iperf/iperf_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/iperf/logs)
when: rolename == "2-host"
+
- name: removing iperf_raw file
shell: rm -rf {{workingdir}}/{{Dest_dir}}/iperf/iperf_raw.json
when: rolename == "2-host"
+
- name: removing iperf_temp
shell: rm -rf {{workingdir}}/{{Dest_dir}}/iperf/iperf_temp
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
- tasks:
+ gather_facts: no
+ tasks:
- name: getting directory
shell: echo $PWD
register: qtip_dir
+
- name: making Netperf directory
file: path={{workingdir}}/{{Dest_dir}}/netperf state=directory
+
- name: making temporary netperf directory
file: path={{workingdir}}/{{Dest_dir}}/netperf/netperf_temp state=directory
- name: Get Hostname
shell: echo $HOSTNAME
register: hostID
- - name: checking_home directory
+
+ - name: checking home directory
shell: echo $HOME
register: home_dir
+
- name: cleaning
shell: rm -rf $HOME/netperf
+
- name: cleaning previous results
shell: rm -rf $HOME/qtip_result
+
- name: making netperf temporary directory
shell: mkdir $HOME/netperf
+
- name: making results temporary directory
shell: mkdir $HOME/qtip_result
- name: Fetching netperf
shell: wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
when: ansible_os_family == "RedHat"
+
- name: Extracting Netperf
shell: tar -xvf netperf-2.7.0.tar.gz
+
- name: configuring netperf
shell: cd $HOME/netperf-2.7.0 && ./configure
+
- name: Making Netperf
shell: cd $HOME/netperf-2.7.0 && make
+
- name: Installing Netperf
shell: cd $HOME/netperf-2.7.0 && make install
- name: Files to Copy
shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.json") | cut -d'/' -f2
register: files_to_copy
+
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/netperf/netperf_temp
- with_items: files_to_copy.stdout_lines
- - hosts: 127.0.0.1
+ with_items: "{{files_to_copy.stdout_lines}}"
+
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: Rolename
set_fact:
rolename: "{{role}}"
when: role is defined
+
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/netperf/netperf_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/netperf/)
when: rolename == "2-host"
+
- name: removing netperf_temp
- shell: rm -rf {{workingdir}}/{{Dest_dir}}/netperf/netperf_temp
\ No newline at end of file
+ shell: rm -rf {{workingdir}}/{{Dest_dir}}/netperf/netperf_temp
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
- tasks:
+ gather_facts: no
+ tasks:
- name: getting directory
shell: echo $PWD
register: qtip_dir
+
- name: making pktgen directory
file: path={{workingdir}}/{{Dest_dir}}/pktgen state=directory
+
- name: making temporary pktgen directory
file: path={{workingdir}}/{{Dest_dir}}/pktgen/pktgen_temp state=directory
- hosts: "{{role}}"
+
tasks:
- name: Rolename
set_fact:
- name: IPTABLE Setup
shell: iptables -F
when: rolename == '1-server'
+
- name: iptables
shell: sudo iptables -A INPUT -p udp --dport 1000 -j DROP
when: rolename == '1-server'
+
- name: run pktgen
shell: bash pktgen.sh {{privateip1}} 1 {{packetsize}} {{duration}} >> .json
when: rolename == '2-host'
+
- hosts: "{{role}}"
+
tasks:
- name: Rolename
set_fact:
rolename: "{{role}}"
when: role is defined
+
- name: Get server packetsize
shell: iptables -L -vnx >> pktgenServer{{privateip1}}.txt
- when: rolename == '1-server'
\ No newline at end of file
+ when: rolename == '1-server'
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making ramspeed directory
file: path={{workingdir}}/{{Dest_dir}}/ramspeed state=directory
+
- name: making temporary ramspeed directory
file: path={{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- - name: checking_home directory
+ - name: checking home directory
shell: echo $HOME
register: home_dir
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp
- with_items: copy_log_results.stdout_lines
+ with_items: "{{copy_log_results.stdout_lines}}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ramspeed/)
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/ramspeed/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ramspeed/logs)
+
- name: removing ramspeed_log
shell: rm -rf {{workingdir}}/{{Dest_dir}}/ramspeed/ramspeed_temp
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making ssl directory
file: path={{workingdir}}/{{Dest_dir}}/ssl state=directory
+
- name: making temporary ssl directory
file: path={{workingdir}}/{{Dest_dir}}/ssl/ssl_temp state=directory
+
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- - name: checking_home directory
+ - name: checking home directory
shell: sudo echo $HOME
register: home_dir
network: false
- name: Installing OpenSSL dependencies when CentOS
- shell: sudo yum install git wget gcc patch perl-Time-HiRes autofconf automake libpcap-devel libtool -y
+ shell: sudo yum install git wget gcc patch perl-Time-HiRes autofconf automake libpcap-devel libtool -y
when: ansible_os_family == "RedHat"
- name: Installing OpenSSL dependencies when Ubuntu
- shell: sudo apt-get install git gcc wget perl autoconf automake libpcap-dev libtool -y
+ shell: sudo apt-get install git gcc wget perl autoconf automake libpcap-dev libtool -y
when: ansible_os_family == "Debian"
- name: Fetching OpenSSL
- name: Benchmaring AES-128-cbc cipher encryption throughput
shell: cd $HOME/Open_SSL/openssl-1.0.2f/apps && sudo ./openssl speed -evp aes-128-cbc >> $HOME/qtip_result/AES-128-CBC_dump
-
- name: Fetching result transformation script
copy: src=./result_transform/ssl/ssl_transform.py dest={{home_dir.stdout}}/qtip_result
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ssl/ssl_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/ssl/ssl_temp
- with_items: copy_log_results.stdout_lines
-
+ with_items: "{{copy_log_results.stdout_lines}}"
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: echo
shell: echo $PWD
+
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ssl/)
+
- name: making_logs_folder
shell: mkdir -p {{workingdir}}/{{Dest_dir}}/ssl/logs
+
- name: extracting_log
shell: ( find {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp/ -name "*.log" | xargs cp -t {{workingdir}}/{{Dest_dir}}/ssl/logs)
+
- name: removing ssl_temp
shell: rm -rf {{workingdir}}/{{Dest_dir}}/ssl/ssl_temp
- name: collecting system information for network test cases
shell: cd $HOME/qtip_result && sudo python info_collect.py n
when: network
-
-
-
-
-
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: making whetstone directory
file: path={{workingdir}}/{{Dest_dir}}/whetstone state=directory
- hosts: "{{role}}"
become: yes
remote_user: "{{username}}"
+
tasks:
- name: storing_home
shell: echo $HOME
- include: ./git_proxy_pbook.yaml
- name: Clone unixbench
- shell: git clone https://github.com/kdlucas/byte-unixbench.git $HOME/tempT
+ git: repo=https://github.com/kdlucas/byte-unixbench.git
+ dest=$HOME/tempT
- name: make
shell: sudo make --directory $HOME/tempT/UnixBench/
- name: copy results
fetch: src={{home_dir.stdout}}/qtip_result/{{item}} dest={{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp
- with_items: files_to_copy.stdout_lines
+ with_items: "{{files_to_copy.stdout_lines}}"
- name: registering log files
shell: (cd $HOME/qtip_result/log/; find . -maxdepth 1 -name "*.log") | cut -d'/' -f2
- name: copying log results
fetch: src={{home_dir.stdout}}/qtip_result/log/{{item}} dest={{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp
- with_items: copy_log_results.stdout_lines
+ with_items: "{{copy_log_results.stdout_lines}}"
- name: cleaning tempT
shell: sudo rm -rf $HOME/tempT
- name: cleaning_qtip_result
shell: sudo rm -rf $HOME/qtip_result
-
- - hosts: 127.0.0.1
+ - hosts: localhost
connection: local
+ gather_facts: no
+
tasks:
- name: extracting_json
shell: ( find {{workingdir}}/{{Dest_dir}}/whetstone/whetstone_temp/ -name "*.json" | xargs cp -t {{workingdir}}/{{Dest_dir}}/whetstone/)
num = len(role[k])
for x in range(num):
f_name_2.write(role[k][x] + '\n')
+ f_name_2.write('[localhost]\n')
+ f_name_2.write('127.0.0.1\n')
f_name_2.close()
@staticmethod
[host]
10.20.0.29
10.20.0.28
+[localhost]
+127.0.0.1