Skip to content

Commit

Permalink
Restart dropin configuration for squid and chrony
Browse files Browse the repository at this point in the history
  • Loading branch information
Elayaraja-Dhanapal authored and yussufsh committed Mar 8, 2021
1 parent 473383c commit d7495fd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions playbooks/roles/ocp-config/files/restart.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
Restart=always
2 changes: 2 additions & 0 deletions playbooks/roles/ocp-config/handlers/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
service:
name: squid
state: restarted
daemon_reload: yes
enabled: yes

- name: restart firewalld
Expand All @@ -16,4 +17,5 @@
service:
name: chronyd
state: restarted
daemon_reload: yes
enabled: yes
14 changes: 14 additions & 0 deletions playbooks/roles/ocp-config/tasks/chrony.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@
- chronyconfig.allow[0] is defined
notify:
- restart chrony

- name: Create chrony dropin directory
file:
path: /etc/systemd/system/chronyd.service.d
state: directory
mode: 0755
become: true

- name: Copy restart conf file to the chrony dropin directory
copy:
src: ../files/restart.conf
dest: /etc/systemd/system/chronyd.service.d/restart.conf
notify:
- restart chrony
14 changes: 14 additions & 0 deletions playbooks/roles/ocp-config/tasks/squid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@
- name: Set proxy details
set_fact:
squid_proxy_url: "http://{{ bastion_vip | default(ansible_host) }}:{{ squid_http_port }}"

- name: Create squid dropin directory
file:
path: /etc/systemd/system/squid.service.d
state: directory
mode: 0755
become: true

- name: Copy restart conf file to the squid dropin directory
copy:
src: ../files/restart.conf
dest: /etc/systemd/system/squid.service.d/restart.conf
notify:
- restart squid

0 comments on commit d7495fd

Please sign in to comment.