From 43501355cf6974ee9ee36ca22c1113d80acffc7d Mon Sep 17 00:00:00 2001 From: "wu.zhihui" Date: Fri, 9 Sep 2016 13:16:09 +0800 Subject: 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 --- benchmarks/playbooks/ramspeed.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'benchmarks/playbooks/ramspeed.yaml') diff --git a/benchmarks/playbooks/ramspeed.yaml b/benchmarks/playbooks/ramspeed.yaml index 096c7320..3fb78cb5 100644 --- a/benchmarks/playbooks/ramspeed.yaml +++ b/benchmarks/playbooks/ramspeed.yaml @@ -1,8 +1,11 @@ - - 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 @@ -10,8 +13,9 @@ - hosts: "{{role}}" become: yes remote_user: "{{username}}" + tasks: - - name: checking_home directory + - name: checking home directory shell: echo $HOME register: home_dir @@ -77,7 +81,7 @@ - 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 @@ -85,16 +89,21 @@ - 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 -- cgit 1.2.3-korg