From 27dd344778f57a329f94f0ad07d542ab59ee6e6a Mon Sep 17 00:00:00 2001 From: kpavic Date: Fri, 29 Jun 2018 12:18:02 +0200 Subject: [PATCH] Fix backslash escaping for build cleanups --- playbooks/roles/os_temps/tasks/handle_os_templates.yml | 4 ++-- playbooks/roles/os_temps/tasks/setup_containers.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/os_temps/tasks/handle_os_templates.yml b/playbooks/roles/os_temps/tasks/handle_os_templates.yml index 6cbc7050..87792b5e 100644 --- a/playbooks/roles/os_temps/tasks/handle_os_templates.yml +++ b/playbooks/roles/os_temps/tasks/handle_os_templates.yml @@ -21,13 +21,13 @@ # Check for failed apps and cleanup - name: "Check for all failed apps on the cluster" - shell: "{{ oc_bin }} get all | egrep 'Failed|Error' | egrep 'builds\/' | awk '{print $1}' | awk -F'/' '{print $2}' | sed 's/-[0-9+]//g' " + shell: "{{ oc_bin }} get all | egrep 'Failed|Error' | egrep 'builds\\/' | awk '{print $1}' | awk -F'/' '{print $2}' | sed 's/-[0-9+]//g' " register: oc_check_app_status ignore_errors: yes when: total_build_success|bool == false - name: "Cleanup all failed dc, bc, routes, svc, and imagestreams on the cluster" - shell: "{{ oc_bin }} get all | grep '{{ failed_container_name }}' | awk '{print $1}' | egrep -v 'builds\/|po\/' | xargs -i {{ oc_bin }} delete {}" + shell: "{{ oc_bin }} get all | grep '{{ failed_container_name }}' | awk '{print $1}' | egrep -v 'builds\\/|po\\/' | xargs -i {{ oc_bin }} delete {}" with_items: "{{ oc_check_app_status.stdout_lines }}" loop_control: loop_var: failed_container_name diff --git a/playbooks/roles/os_temps/tasks/setup_containers.yml b/playbooks/roles/os_temps/tasks/setup_containers.yml index 647661f6..769e0a47 100644 --- a/playbooks/roles/os_temps/tasks/setup_containers.yml +++ b/playbooks/roles/os_temps/tasks/setup_containers.yml @@ -35,12 +35,12 @@ # Check for failed apps and cleanup - name: "Check for all failed apps on the cluster" - shell: "{{ oc_bin }} get all | egrep 'Failed|Error' | egrep 'builds\/' | awk '{print $1}' | awk -F'/' '{print $2}' | sed 's/-[0-9+]//g' " + shell: "{{ oc_bin }} get all | egrep 'Failed|Error' | egrep 'builds\\/' | awk '{print $1}' | awk -F'/' '{print $2}' | sed 's/-[0-9+]//g' " register: oc_check_app_status ignore_errors: yes - name: "Cleanup all failed dc, bc, routes, svc, and imagestreams on the cluster" - shell: "{{ oc_bin }} get all | grep '{{ failed_container_name }}' | awk '{print $1}' | egrep -v 'builds\/|po\/' | xargs -i {{ oc_bin }} delete {}" + shell: "{{ oc_bin }} get all | grep '{{ failed_container_name }}' | awk '{print $1}' | egrep -v 'builds\\/|po\\/' | xargs -i {{ oc_bin }} delete {}" with_items: "{{ oc_check_app_status.stdout_lines }}" loop_control: loop_var: failed_container_name