ansible-roles/squid/tasks/main.yml

46 lines
1 KiB
YAML

---
- name: Include OS-specific variables
include_vars: "{{ ansible_os_family }}-{{ ansible_distribution_release }}.yml"
- name: package is installed
apt:
name: "{{ squid_package }}"
state: present
- name: squid.conf is present
template:
src: squid.j2
dest: "{{ squid_conf_file }}"
notify: "restart {{ squid_daemon }}"
- name: evolix whitelist is present
copy:
src: whitelist-evolinux.conf
dest: "{{ squid_conf_path }}/whitelist-evolinux.conf"
force: yes
backup: yes
notify: "reload {{ squid_daemon }}"
- name: custom whitelist is present
copy:
src: whitelist-custom.conf
dest: "{{ squid_conf_path }}/whitelist-custom.conf"
force: no
notify: "reload {{ squid_daemon }}"
- name: add some URL in whitelist
lineinfile:
insertafter: EOF
dest: "{{ squid_conf_path }}/whitelist-custom.conf"
line: "{{ item }}"
state: present
with_items: '{{ squid_whitelist_items }}'
notify: "reload {{ squid_daemon }}"
- include: logrotate.yml
- include: minifirewall.yml
- include: log2mail.yml