From 644d34d4be1ffcbfe4b973d9d53d1de43c810a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Thu, 5 Oct 2017 15:29:17 +0200 Subject: [PATCH] retrace: deal with exit code 1 when record is already presented --- roles/abrt/faf-local/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/abrt/faf-local/tasks/main.yml b/roles/abrt/faf-local/tasks/main.yml index aaadea5b3b..be87ade7d4 100644 --- a/roles/abrt/faf-local/tasks/main.yml +++ b/roles/abrt/faf-local/tasks/main.yml @@ -61,8 +61,9 @@ line: ' MORE_SATYR = "https://github.com/abrt/satyr/"' notify: restart httpd +# the magic with ! is that it return exit code 1 if ERROR is present in output - name: add repositories - command: faf repoadd "{{ item.name }}" yum "{{ item.url }}" + command: ! faf repoadd "{{ item.name }}" yum "{{ item.url }}" | grep ERROR become: yes become_user: faf ignore_errors: yes @@ -71,7 +72,7 @@ with_items: "{{ faf_repos }}" - name: repoassign repositories - command: faf repoassign "{{ item.name }}" "{{ item.opsys }}" "{{ item.arch }}" + command: ! faf repoassign "{{ item.name }}" "{{ item.opsys }}" "{{ item.arch }}" | grep ERROR become: yes become_user: faf ignore_errors: yes