---
- hosts: centos8_init
user: ioniere
become: yes
tasks:
- name: bind 설치
yum:
name: ['bind', 'bind-chroot']
state: latest
- name: bind-chroot on
command: /usr/libexec/setup-named-chroot.sh /var/named/chroot on
- name: /etc/sysconfig/named 수정 - ipv4만 사용
blockinfile:
path: /etc/sysconfig/named
insertafter: EOF
block: |
OPTIONS="-4"
- name: named.conf 복사
get_url:
url: http://data.yeonghoon.kim/centos8_bind/source/named.conf
dest: /etc/named.conf
force: yes
- name: named.conf 수정 관련 스크립트
get_url:
url: http://data.yeonghoon.kim/centos8_bind/source/named_ip_add.sh
dest: /tmp/named_ip_add.sh
force: yes
- name: named.conf 수정 스크립트 실행
command: sh /tmp/named_ip_add.sh
- name: named-chroot 구동 및 부팅 시 구동되도록 설정
service:
name: named-chroot
state: started
enabled: yes
host, user은 상황에 맞게 수정 후 사용
방화벽 설정은 별도로 진행(53)
zone파일 추가, named.rfc1912.zone 수정 후 사용