From 5809b88ba4ce9bb1b47b802067a5c2f60ca8ade9 Mon Sep 17 00:00:00 2001 From: yuncliu Date: Mon, 7 Dec 2020 10:33:51 +0800 Subject: [PATCH] modify cann install result check --- playbooks/install_nnae.yml | 2 +- playbooks/install_nnrt.yml | 2 +- playbooks/install_tfplugin.yml | 2 +- playbooks/install_toolkit.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/install_nnae.yml b/playbooks/install_nnae.yml index cd83b111..ed05a2b9 100644 --- a/playbooks/install_nnae.yml +++ b/playbooks/install_nnae.yml @@ -22,6 +22,6 @@ LD_LIBRARY_PATH: /usr/local/python3.7.5/lib register: nnae_result when: nnae.matched > 0 - failed_when: "'install success' not in nnae_result.stdout and 'already installed' not in nnae_result.stdout" + failed_when: "nnae_result.rc != 0 and ('install success' not in nnae_result.stdout and 'already installed' not in nnae_result.stdout)" - debug: var=nnae_result diff --git a/playbooks/install_nnrt.yml b/playbooks/install_nnrt.yml index 06ba7a76..e06eea16 100644 --- a/playbooks/install_nnrt.yml +++ b/playbooks/install_nnrt.yml @@ -19,6 +19,6 @@ shell: "{{ nnrt.files[0].path }} --install --quiet --install-username={{ user }} --install-usergroup={{ group }}" register: nnrt_result when: nnrt.matched > 0 - failed_when: "'install success' not in nnrt_result.stdout and 'already installed' not in nnrt_result.stdout" + failed_when: "nnrt_result.rc != 0 and ('install success' not in nnrt_result.stdout and 'already installed' not in nnrt_result.stdout)" - debug: var=nnrt_result diff --git a/playbooks/install_tfplugin.yml b/playbooks/install_tfplugin.yml index 5ed208ae..70cd15c4 100644 --- a/playbooks/install_tfplugin.yml +++ b/playbooks/install_tfplugin.yml @@ -22,6 +22,6 @@ PATH: /usr/local/python3.7.5/bin:{{ ansible_env.PATH }} register: tfplugin_result when: tfplugin.matched > 0 - failed_when: "'install success' not in tfplugin_result.stdout and 'already installed' not in tfplugin_result.stdout" + failed_when: "tfplugin_result.rc !=0 and ('install success' not in tfplugin_result.stdout and 'already installed' not in tfplugin_result.stdout)" - debug: var=tfplugin_result diff --git a/playbooks/install_toolkit.yml b/playbooks/install_toolkit.yml index 2418ec1c..b82928f6 100644 --- a/playbooks/install_toolkit.yml +++ b/playbooks/install_toolkit.yml @@ -22,6 +22,6 @@ PATH: /usr/local/python3.7.5/bin:{{ ansible_env.PATH }} register: toolkit_result when: toolkit.matched > 0 - failed_when: "'install success' not in toolkit_result.stdout and 'already installed' not in toolkit_result.stdout" + failed_when: "toolkit_result.rc != 0 and ('install success' not in toolkit_result.stdout and 'already installed' not in toolkit_result.stdout)" - debug: var=toolkit_result -- Gitee