Skip to content

Commit

Permalink
Fix backslash escaping for build cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
dirgim committed Jun 29, 2018
1 parent c3444a0 commit 27dd344
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions playbooks/roles/os_temps/tasks/handle_os_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions playbooks/roles/os_temps/tasks/setup_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27dd344

Please sign in to comment.