diff options
author | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-09-09 13:16:09 +0800 |
---|---|---|
committer | zhihui wu <wu.zhihui1@zte.com.cn> | 2016-09-11 04:01:38 +0000 |
commit | 43501355cf6974ee9ee36ca22c1113d80acffc7d (patch) | |
tree | 2236e14f13b2afd990aa26e0dd24d55052bed377 /benchmarks/playbooks/netperf.yaml | |
parent | 3a987ca748287d250d7975a853222917f001469a (diff) |
ansible playbook bugfix
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>
Diffstat (limited to 'benchmarks/playbooks/netperf.yaml')
-rw-r--r-- | benchmarks/playbooks/netperf.yaml | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/benchmarks/playbooks/netperf.yaml b/benchmarks/playbooks/netperf.yaml index 30f4b574..a07752cb 100644 --- a/benchmarks/playbooks/netperf.yaml +++ b/benchmarks/playbooks/netperf.yaml @@ -1,12 +1,15 @@ - - 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 @@ -24,27 +27,36 @@ - 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 @@ -62,18 +74,24 @@ - 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 |