Skip to content

Commit

Permalink
Merge pull request #518 from redhatci/gather_logs_issue
Browse files Browse the repository at this point in the history
Create the logs directory if defined but does not exist
  • Loading branch information
tkrishtop authored Jan 6, 2025
2 parents 9ec0568 + 2767827 commit d4e1994
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions roles/get_logs_from_namespace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
- glfn_ns | string
- glfn_oc | string

- name: Check provided logs directory exists
ansible.builtin.stat:
- name: Create the logs directory if defined but does not exist
ansible.builtin.file:
path: "{{ glfn_dir }}"
register: dir_stat
state: directory
mode: '0775'
when: glfn_dir is defined
failed_when:
- glfn_dir is defined
- not dir_stat.stat.exists

- name: Create logs directory when not provided
when: glfn_dir is not defined
Expand Down

0 comments on commit d4e1994

Please sign in to comment.