Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
t:
strace -f -ostrace.txt -e open PYTHONPATH=/home/mdupont/experiments/ccore/ansible/lib python /home/mdupont/experiments/ccore/ansible/bin/ansible-playbook -i ansible_hosts test_playbook.yml --verbose

t2:
PYTHONPATH=/home/mdupont/experiments/ccore/ansible/lib python /home/mdupont/experiments/ccore/ansible/bin/ansible-playbook -i ansible_hosts test_playbook.yml --verbose
2 changes: 2 additions & 0 deletions ansible_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
local ansible_user=vagrant ansible_host=127.0.0.1 ansible_ssh_port=2200 bind_zone_master_server_ip=127.0.0.1
22 changes: 18 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: install bind packages
apt: pkg={{ item }} state={{ bind_pkg_state }}
with_items: bind_pkgs
with_items:
- "{{ bind_pkgs }}"

- name: setup zone directories
file: dest={{ bind_base_zones_path }}/{{ item }} state=directory owner={{ bind_user }} group={{ bind_group }} mode=0755
Expand All @@ -25,9 +26,22 @@
template: src=named.conf.options.j2 dest={{ bind_config_basepath }}/named.conf.options owner={{ bind_user }} group={{ bind_group }} mode=0600
notify: restart bind

- name: Copy master zone files
copy: src={{ bind_masterzones_path }}/db.{{ item.name }} dest={{ bind_base_zones_path }}/{{bind_masterzones_path}} owner={{ bind_user }} group={{ bind_group }}
with_items: bind_config_master_zones
# - debug: var=bind_masterzones_path
# - debug: var=bind_base_zones_path
# - debug: var=bind_config_master_zones
# - debug: var=bind_user
# - debug: var=bind_group

# - name: Copy master zone files
# #shell: echo src={{ bind_masterzones_path }}/db.{{ item.name }} dest={{ bind_base_zones_path }} owner={{ bind_user }} group={{ bind_group }}
# shell: echo "src={{ bind_masterzones_path }}/db.{{ item.name }} dest={{ bind_base_zones_path }} owner={{ bind_user }} group={{ bind_group }}"
# with_items:
# - "{{bind_config_master_zones}}"

- name: Copy master zone files2
copy: src="{{ bind_masterzones_path }}/db.{{ item.name }}" dest="{{ bind_base_zones_path }}" owner="{{ bind_user }}" group="{{ bind_group }}"
with_items:
- "{{bind_config_master_zones}}"
notify: reload bind
tags: bind-zones

Expand Down
13 changes: 13 additions & 0 deletions test_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- hosts: all
remote_user: root
sudo: True
vars:
bind_masterzones_path: zones
bind_config_master_zones:
- name: example.com
- name: example2.com
- name: example3.com

roles:
- { role: ../ansible-role-bind }
Empty file added zones/db.example.com
Empty file.
Empty file added zones/db.example2.com
Empty file.
1 change: 1 addition & 0 deletions zones/db.example3.com
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# bla