Skip to content

Instantly share code, notes, and snippets.

@jpmens

jpmens/all.yml Secret

Created Dec 10, 2019
Embed
What would you like to do?
Simple Ansible playbook to install BIND and nginx in 170 jails
- 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
You can’t perform that action at this time.