yeonghoon.kim

  • 게시판
  • 갤러리
  • aws

CentOS8 pdns 설치 - centos8_pdns.yml

김영훈 2019.10.16 16:17 조회 수 : 354

---
- hosts: centos8_init
  user: ioniere
  become: yes

  vars:
    root_db_pass: secret
    pdns_db_pass: secretpdns

  tasks:

  - name: epel-release 설치
    yum:
      name: epel-release
      state: latest

  - name: pdns 설치
    yum:
      name: ['pdns', 'pdns-backend-mysql']
      state: latest

  - name: pdns.conf 다운로드
    get_url:
      url: http://data.yeonghoon.kim/centos8_pdns/source/pdns.conf
      dest: /etc/pdns/pdns.conf
      force: yes

  - name: pdns 기본 디비 구성 파일 다운로드
    get_url:
      url: http://data.yeonghoon.kim/centos8_pdns/source/pdns_db_setup.sql
      dest: /tmp/pdns_db_setup.sql
      force: yes

  - name: pdns.conf 디비 사용자 패스워드 입력
    blockinfile:
      path: /etc/pdns/pdns.conf
      insertafter: EOF
      block: |
        gmysql-password={{ pdns_db_pass }}

  - name: mysql 루트 패스워드 설정
    lineinfile:
      path: /tmp/pdns_db_setup.sql
      regexp: '^GRANT'
      line: "GRANT ALL PRIVILEGES ON pdns.* TO pdns@localhost IDENTIFIED BY '{{ pdns_db_pass }}';"

  - name: pdns 디비 구성
    shell: "mysql -uroot -p{{ root_db_pass }} < /tmp/pdns_db_setup.sql"

  - name: pdns_db_setup 삭제
    file:
      path: /tmp/pdns_db_setup.sql
      state: absent

  - name: pdns 구동 및 부팅 시 구동되도록 설정
    service:
      name: pdns
      state: started
      enabled: yes

 host, user, root_db_passwd, pdns_db_passwd는 상황에 맞게 수정
로컬에 mysql 설치가 되어 있어야 하며, root 계정으로 디비 제어가 가능해야 함.

root_db_passwd는 해당 서버의 디비 루트 패스워드
pdns_db_passwd는 원하는 패스워드

방화벽 설정은 별도로 진행(53)


  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

사진 및 파일 첨부

여기에 파일을 끌어 놓거나 왼쪽의 버튼을 클릭하세요.

파일 용량 제한 : 0MB (허용 확장자 : *.*)

업로드 중... (0%)

0개 첨부 됨 ( / )
 
번호 제목 글쓴이 날짜 조회 수
공지 2025 일본 여행 계획 김영훈 2024.10.10 1108
공지 현금, 저축, 투자, 지출, 예산, 보험 내역(2024-05-30) 김영훈 2024.03.10 765
» CentOS8 pdns 설치 - centos8_pdns.yml 김영훈 2019.10.16 354
244 rsync 전송 에러 트러블슈팅 김영훈 2019.10.17 359
243 PowerDNS 유저 패스워드 변경 김영훈 2019.10.18 312
242 nagios-plugins-disk - dfree_units 0 0 버그 김영훈 2019.10.21 273
241 20191022 민방위 김영훈 2019.10.22 150
240 배달의민족 사용 금액 김영훈 2019.10.31 127
239 CentOS8 Let's Encrypt 적용 - nginx, certbot 이용 김영훈 2019.10.31 2453
238 엑셀 줄바꿈(alt + enter) 찾기 김영훈 2019.11.04 112
237 IIS 503 에러 - 응용프로그램풀 죽는 현상 김영훈 2019.11.04 436
236 nginx 443 -> 80 리다이렉트 김영훈 2019.11.06 120
235 sendmail 구동 안되는 현상 김영훈 2019.11.07 273
234 SSH 클라이언트 소개 및 서버 접속 방법 김영훈 2019.11.10 216
233 kvm virt-install 예시 김영훈 2019.11.10 114
232 CentOS7 Minimal 설치 및 네트워크 설정 김영훈 2019.11.10 214
231 CentOS7 설치 후 기본 설정 김영훈 2019.11.10 162
230 CentOS7 vsftpd 설치 및 설정 김영훈 2019.11.10 187
229 CentOS7 네트워크 장치명 변경(eth0) 김영훈 2019.11.10 143
228 도메인 구매 및 사용 방법 김영훈 2019.11.10 244
227 CentOS7 BIND 설치 및 설정 김영훈 2019.11.10 113
226 CentOS7 메일 서버 구축 #1 - Sendmail 설치 및 설정 김영훈 2019.11.10 125
쓰기 태그
 첫 페이지 1 2 3 4 5 6 7 8 9 10 끝 페이지