Skip to content

Commit

Permalink
Replace unnecessary shell with command
Browse files Browse the repository at this point in the history
  • Loading branch information
widhalmt committed Oct 13, 2023
1 parent 2f5a802 commit 51967e2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
5 changes: 2 additions & 3 deletions roles/beats/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@
when: beats_metricbeat | bool

# Free up some space to let elsticsearch allocate replica in GitHub Action
- name: Remove cache # noqa: risky-shell-pipe
ansible.builtin.shell: >
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
- name: Remove cache
ansible.builtin.command: >
rm -rf /var/cache/*
changed_when: false
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"
5 changes: 2 additions & 3 deletions roles/elasticsearch/tasks/elasticsearch-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,8 @@
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"
block:
# Free up some space to let elsticsearch allocate replica in GitHub Action
- name: Remove cache # noqa: risky-shell-pipe
ansible.builtin.shell: >
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
- name: Remove cache
ansible.builtin.command: >
rm -rf /var/cache/*
changed_when: false

Expand Down
5 changes: 2 additions & 3 deletions roles/elasticsearch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"

# Free up some space to let elsticsearch allocate replica in GitHub Action
- name: Remove cache # noqa: risky-shell-pipe
ansible.builtin.shell: >
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
- name: Remove cache
ansible.builtin.command: >
rm -rf /var/cache/*
changed_when: false
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"
Expand Down
5 changes: 2 additions & 3 deletions roles/kibana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@
port: 5601

# Free up some space to let elsticsearch allocate replica in GitHub Action
- name: Remove cache # noqa: risky-shell-pipe
ansible.builtin.shell: >
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
- name: Remove cache
ansible.builtin.command: >
rm -rf /var/cache/*
changed_when: false
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"
5 changes: 2 additions & 3 deletions roles/logstash/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@
register: logstash_freshstart

# Free up some space to let elsticsearch allocate replica in GitHub Action
- name: Remove cache # noqa: risky-shell-pipe
ansible.builtin.shell: >
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
- name: Remove cache
ansible.builtin.command: >
rm -rf /var/cache/*
changed_when: false
when: ansible_virtualization_type == "container" or ansible_virtualization_type == "docker"

0 comments on commit 51967e2

Please sign in to comment.