mirror of
https://github.com/trailofbits/algo
synced 2024-11-16 12:12:55 +00:00
6facb6cb4f
* FreeBSD draft ifconfig fix Pre-tasks fixes fix hardcoded IP some refactoring disable system-based tags disable freebsd tags FreeBSD vpn role add defaults ssh role freebsd default fix dns_adblocking freebsd ubuntu dict fix * HardenedBSD update-users BSD * Rebuild the kernel docs changing
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
- name: Gather Facts
|
|
setup:
|
|
|
|
- name: Dnsmasq installed
|
|
package: name=dnsmasq
|
|
|
|
- name: Ensure that the dnsmasq user exist
|
|
user: name=dnsmasq groups=nogroup append=yes state=present
|
|
|
|
- name: The dnsmasq directory created
|
|
file: dest=/var/lib/dnsmasq state=directory mode=0755 owner=dnsmasq group=nogroup
|
|
|
|
- include: ubuntu.yml
|
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
|
|
|
- include: freebsd.yml
|
|
when: ansible_distribution == 'FreeBSD'
|
|
|
|
- meta: flush_handlers
|
|
|
|
- name: Dnsmasq configured
|
|
template: src=dnsmasq.conf.j2 dest="{{ config_prefix|default('/') }}etc/dnsmasq.conf"
|
|
notify:
|
|
- restart dnsmasq
|
|
|
|
- name: Adblock script created
|
|
template: src=adblock.sh dest=/usr/local/sbin/adblock.sh owner=root group="{{ root_group|default('root') }}" mode=0755
|
|
|
|
- name: Adblock script added to cron
|
|
cron:
|
|
name: Adblock hosts update
|
|
minute: 10
|
|
hour: 2
|
|
job: /usr/local/sbin/adblock.sh
|
|
user: dnsmasq
|
|
|
|
- name: Update adblock hosts
|
|
shell: >
|
|
sudo -u dnsmasq "/usr/local/sbin/adblock.sh"
|
|
|
|
- name: Dnsmasq enabled and started
|
|
service: name=dnsmasq state=started enabled=yes
|