39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
---
|
|
- block:
|
|
- name: Install the squid package on RH based systems
|
|
yum: pkg=squid state=present
|
|
|
|
when:
|
|
- ansible_distribution_file_variety == "RedHat"
|
|
- squid_install | bool
|
|
tags: [ 'squid', 'proxy' ]
|
|
|
|
- block:
|
|
- name: Install the squid package on Debian based systems
|
|
apt: pkg=squid state=present cache_valid_time=3600
|
|
|
|
when:
|
|
- ansible_distribution_file_variety == "Debian"
|
|
- squid_install | bool
|
|
tags: [ 'squid', 'proxy' ]
|
|
|
|
- block:
|
|
- name: Install the squid configuration file
|
|
template: src=squid.conf.j2 dest=/etc/squid/squid.conf
|
|
notify: Reload squid
|
|
|
|
- name: Ensure that the squid service is running and enabled
|
|
service: name=squid state=started enabled=yes
|
|
|
|
when: squid_install | bool
|
|
tags: [ 'squid', 'proxy' ]
|
|
|
|
- name: Manage the squid firewalld rules
|
|
block:
|
|
- name: Manage the squid related firewall service
|
|
firewalld: service={{ item.service }} zone={{ item.zone }} permanent={{ item.permanent | default(True) }} state={{ item.state }} immediate=True
|
|
with_items: '{{ squid_firewalld_services }}'
|
|
|
|
when: ansible_distribution_file_variety == "RedHat"
|
|
tags: [ 'squid', 'proxy', 'firewall', 'firewalld', 'iptables', 'iptables_rules' ]
|