--- - name: install package ansible.builtin.package: name: - squid tags: squid - name: copy list files ansible.builtin.copy: content: "{{ item.value|join('\n') }}" dest: '/etc/squid/{{ item.key }}.list' owner: root group: proxy mode: 0640 loop: '{{ squid_acl_lists|dict2items }}' loop_control: label: '{{ item.key }}' notify: reload squid tags: squid - name: copy config file ansible.builtin.template: src: squid.conf.j2 dest: /etc/squid/squid.conf owner: root group: proxy mode: 0640 validate: squid -k parse -f %s notify: reload squid tags: squid - name: enable and start service ansible.builtin.service: name: squid enabled: true state: started tags: squid