-
-
Save jpmens/5659269454de6a4777e0dd3779b44a85 to your computer and use it in GitHub Desktop.
Simple Ansible playbook to install BIND and nginx in 170 jails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: bsd | |
remote_user: root | |
serial: 10 | |
vars: | |
packagelist: [ bash, micro_httpd, bind-tools, bind914, nginx-lite ] | |
tasks: | |
- name: copy a file | |
copy: src=all.yml dest=/tmp/all.yml | |
- name: install packages | |
pkgng: name="{{ packagelist }}" | |
notify: | |
- kick_nginx | |
- name: enable named | |
command: /usr/sbin/sysrc named_enable=YES | |
- name: rndc-confgen | |
command: /usr/local/sbin/rndc-confgen -a creates=/usr/local/etc/namedb/rndc.key | |
notify: kick_named | |
- name: install named.conf from template | |
template: src=named.conf dest=/usr/local/etc/namedb/named.conf | |
notify: kick_named | |
handlers: | |
- name: kick_named | |
service: name=named state=restarted | |
- name: kick_nginx | |
service: name=nginx state=restarted enabled=true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment