Commit c2ad6834 authored by nanahira's avatar nanahira

move dnsmasq

parent fc7072de
...@@ -53,61 +53,8 @@ ...@@ -53,61 +53,8 @@
with_items: with_items:
- iptables-forward.sh - iptables-forward.sh
- iptables-gateways-interpreter.sh - iptables-gateways-interpreter.sh
- name: dnsmasq directory - name: dnsmasq
file: import_tasks: ./tasks/dnsmasq.yaml
name: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/{{item}}'
state: directory
recurse: true
with_items:
- smartdns
- dnsmasq.d
- misc
- smartdns-cache
- name: dnsmasq docker-compose
copy:
src: ./files/dnsmasq/docker-compose.yml
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/docker-compose.yml'
- name: dnsmasq.conf
template:
src: ./files/dnsmasq/dnsmasq.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.conf'
notify: restart_dnsmasq
- name: smartdns.conf
template:
src: ./files/dnsmasq/smartdns.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf'
notify: restart_dnsmasq
- name: smartdns china list
copy:
src: ./data/china-list.conf
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf'
notify: restart_dnsmasq
- name: update dnsmasq.d
synchronize:
src: ./mycard-dnsmasq/dnsmasq.d/
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d'
recursive: yes
verify_host: no
checksum: yes
archive: no
notify: restart_dnsmasq
when: dnsmasq.mycardDomains is defined and dnsmasq.mycardDomains
- name: gfwlist ipset
copy:
src: './data/gfwlist-ipset.conf'
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
when: dnsmasq.gfwlistIPSet is defined and dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: gfwlist ipset clean
file:
path: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
state: absent
when: dnsmasq.gfwlistIPSet is defined and not dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: start dnsmasq
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq'
remove_orphans: true
handlers: handlers:
- name: restart_dnsmasq - name: restart_dnsmasq
docker_compose: docker_compose:
......
...@@ -138,61 +138,8 @@ ...@@ -138,61 +138,8 @@
template: template:
src: ./files/dhcpv6/docker-compose.yml.j2 src: ./files/dhcpv6/docker-compose.yml.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dhcpv6/docker-compose.yml' dest: '{{ansible_user_dir}}/nextgen-router/services/dhcpv6/docker-compose.yml'
- name: dnsmasq directory - name: dnsmasq
file: import_tasks: ./tasks/dnsmasq.yaml
name: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/{{item}}'
state: directory
recurse: true
with_items:
- smartdns
- dnsmasq.d
- misc
- smartdns-cache
- name: dnsmasq docker-compose
copy:
src: ./files/dnsmasq/docker-compose.yml
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/docker-compose.yml'
- name: dnsmasq.conf
template:
src: ./files/dnsmasq/dnsmasq.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.conf'
notify: restart_dnsmasq
- name: smartdns.conf
template:
src: ./files/dnsmasq/smartdns.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf'
notify: restart_dnsmasq
- name: smartdns china list
copy:
src: ./data/china-list.conf
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf'
notify: restart_dnsmasq
- name: update dnsmasq.d
synchronize:
src: ./mycard-dnsmasq/dnsmasq.d/
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d'
recursive: yes
verify_host: no
checksum: yes
archive: no
notify: restart_dnsmasq
when: dnsmasq.mycardDomains is defined and dnsmasq.mycardDomains
- name: gfwlist ipset
copy:
src: './data/gfwlist-ipset.conf'
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
when: dnsmasq.gfwlistIPSet is defined and dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: gfwlist ipset clean
file:
path: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
state: absent
when: dnsmasq.gfwlistIPSet is defined and not dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: start dnsmasq
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq'
remove_orphans: true
handlers: handlers:
- name: restart_dnsmasq - name: restart_dnsmasq
docker_compose: docker_compose:
......
- name: dnsmasq directory
file:
name: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/{{item}}'
state: directory
recurse: true
with_items:
- smartdns
- dnsmasq.d
- misc
- smartdns-cache
- name: dnsmasq docker-compose
copy:
src: ../files/dnsmasq/docker-compose.yml
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/docker-compose.yml'
- name: dnsmasq.conf
template:
src: ../files/dnsmasq/dnsmasq.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.conf'
notify: restart_dnsmasq
- name: smartdns.conf
template:
src: ../files/dnsmasq/smartdns.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf'
notify: restart_dnsmasq
- name: smartdns china list
copy:
src: ../data/china-list.conf
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf'
notify: restart_dnsmasq
- name: update dnsmasq.d
synchronize:
src: ../mycard-dnsmasq/dnsmasq.d/
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d'
recursive: yes
verify_host: no
checksum: yes
archive: no
notify: restart_dnsmasq
when: dnsmasq.mycardDomains is defined and dnsmasq.mycardDomains
- name: gfwlist ipset
copy:
src: '../data/gfwlist-ipset.conf'
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
when: dnsmasq.gfwlistIPSet is defined and dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: gfwlist ipset clean
file:
path: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
state: absent
when: dnsmasq.gfwlistIPSet is defined and not dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: start dnsmasq
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq'
remove_orphans: true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment