Skip to content

Commit

Permalink
Merge pull request #8 from stone-payments/feat/create-custom-dir
Browse files Browse the repository at this point in the history
Custom dir
  • Loading branch information
bcdonadio authored Aug 20, 2018
2 parents 449c6b8 + 9547206 commit 249b422
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/custom-whitelist.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: populate squid_custom_acls with src
set_fact:
squid_custom_acls: "{{ squid_custom_acls|default([]) +[{'name': item.name+'_src', 'type': 'src', 'arg': '\"/etc/squid/'+item.name+'_src\"'}] }}"
squid_custom_acls: "{{ squid_custom_acls|default([]) +[{'name': item.name+'_src', 'type': 'src', 'arg': '\"'+squid_acl_dir+'/'+item.name+'_src\"'}] }}"
with_items: "{{ squid_custom_whitelist }}"

- name: populate squid_custom_acls with domain
set_fact:
squid_custom_acls: "{{ squid_custom_acls|default([]) +[{'name': item.name+'_dstdomain', 'type': 'dstdomain', 'arg': '\"/etc/squid/'+item.name+'_dstdomain\"'}] }}"
squid_custom_acls: "{{ squid_custom_acls|default([]) +[{'name': item.name+'_dstdomain', 'type': 'dstdomain', 'arg': '\"'+squid_acl_dir+'/'+item.name+'_dstdomain\"'}] }}"
with_items: "{{ squid_custom_whitelist }}"

- name: populate squid_custom_http_access with dest empty
Expand All @@ -21,22 +21,22 @@
when: item.dest is defined and item.dest|length > 0 and item.dest.0 != None
with_items: "{{ squid_custom_whitelist }}"

- name: make sure /etc/squid dir exists
- name: make sure {{ squid_acl_dir }} dir exists
file:
path: /etc/squid
path: "{{ squid_acl_dir }}"
state: directory

- name: create src files
template:
src: src_file.j2
dest: "/etc/squid/{{ item.name }}_src"
dest: "{{ squid_acl_dir }}/{{ item.name }}_src"
with_items: "{{ squid_custom_whitelist }}"
notify: restart squid

- name: create domain files
template:
src: dest_file.j2
dest: "/etc/squid/{{ item.name }}_dstdomain"
dest: "{{ squid_acl_dir }}/{{ item.name }}_dstdomain"
when: item.dest is defined and item.dest|length > 0 and item.dest.0 != None
with_items: "{{ squid_custom_whitelist }}"
notify: restart squid
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
# vars file for squid
squid_acl_dir: /etc/squid/acl_files

0 comments on commit 249b422

Please sign in to comment.