Skip to content

Commit

Permalink
Revert "Fix role failing on Squid task "Create the cache directories …
Browse files Browse the repository at this point in the history
…for the first time""

This reverts commit f220483.
  • Loading branch information
kysrpex committed Jun 28, 2023
1 parent f220483 commit 58679a5
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions tasks/squid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
backup: true
mode: 0644
notify:
- Restart squid
- restart squid

- name: Fix cache directory permission
ansible.builtin.file:
Expand All @@ -18,27 +18,13 @@
setype: squid_cache_t
when: cvmfs_stratum1_cache_dir is defined

- name: Check whether the cache directories exist
ansible.builtin.stat:
path: "{{ cvmfs_stratum1_cache_dir.dir }}/00"
register: cvmfs_stratum1_cache_dir_stat
when: cvmfs_stratum1_cache_dir is defined

- name: Create the cache directories for the first time
when: cvmfs_stratum1_cache_dir is defined and not cvmfs_stratum1_cache_dir_stat.stat.exists
block:

- name: Ensure squid is stopped
ansible.builtin.service:
name: "{{ cvmfs_squid_service_name }}"
state: stopped

- name: Create the cache directories
become: true
become_user: "{{ cvmfs_squid_user }}"
ansible.builtin.command: squid -z
args:
creates: "{{ cvmfs_stratum1_cache_dir.dir }}/00"
become: true
become_user: "{{ cvmfs_squid_user }}"
ansible.builtin.command: squid -z
args:
creates: "{{ cvmfs_stratum1_cache_dir }}/00"
when: cvmfs_stratum1_cache_dir is defined

- name: Ensure squid is enabled and started
ansible.builtin.service:
Expand Down

0 comments on commit 58679a5

Please sign in to comment.