Commit 3b2a8183 by Your Name

Renamed wireless dns team bind template file

parent 2c61093d
...@@ -18,32 +18,32 @@ ...@@ -18,32 +18,32 @@
- name: Get bind source tarball from ftp://ftp.isc.org. - name: Get bind source tarball from ftp://ftp.isc.org.
get_url: get_url:
url: http://ftp.isc.org/isc/bind9/{{ d['tag'] }}/bind-{{ d['tag'] }}.tar.gz url: http://ftp.isc.org/isc/bind9/{{ d['tag'] }}/bind-{{ d['tag'] }}.tar.gz
dest: /home/bind-{{ d['tag'] }}.tar.gz dest: /tmp/bind-{{ d['tag'] }}.tar.gz
- name: untar the source tarball to managed node's /tmp. - name: untar the source tarball to managed node's /tmp.
unarchive: unarchive:
src: /home/bind-{{ d['tag'] }}.tar.gz src: /tmp/bind-{{ d['tag'] }}.tar.gz
dest: /home dest: /tmp
remote_src: True remote_src: True
- name: configure bind. - name: configure bind.
shell: ./configure --prefix=/var/named-{{ d['tag'] }} --with-openssl=/usr --sysconfdir=/etc --enable-ipv6 --enable-threads shell: ./configure --prefix=/var/named-{{ d['tag'] }} --with-openssl=/usr --sysconfdir=/etc --enable-ipv6 --enable-threads
args: args:
chdir: /home/bind-{{ d['tag'] }} chdir: /tmp/bind-{{ d['tag'] }}
- name: make bind. - name: make bind.
shell: make -j {{ ansible_processor_vcpus }} shell: make -j {{ ansible_processor_vcpus }}
args: args:
chdir: /home/bind-{{ d['tag'] }} chdir: /tmp/bind-{{ d['tag'] }}
- name: make install bind. - name: make install bind.
shell: make install shell: make install
args: args:
chdir: /home/bind-{{ d['tag'] }} chdir: /tmp/bind-{{ d['tag'] }}
- name: Clean untarred source - name: Clean untarred source
file: file:
path: /home/bind-{{ d['tag'] }} path: /tmp/bind-{{ d['tag'] }}
state: absent state: absent
- name: Create named user. - name: Create named user.
...@@ -85,42 +85,41 @@ ...@@ -85,42 +85,41 @@
dest: /usr/sbin/rndc dest: /usr/sbin/rndc
state: link state: link
- name: Make directory forward/black. - name: Make directory log
file: file:
path: /var/named-{{ d['tag'] }}/forward/black path: /var/named-{{ d['tag'] }}/log
state: directory state: directory
mode: 0755
- name: Copy xx.com. - name: Copy named.local.
copy: copy:
src: xx.com src: named.local
dest: /var/named-{{ d['tag'] }}/forward/black/ dest: /var/named-{{ d['tag'] }}/named.local
- name: Copy smartjuso.conf. - name: Copy named.root.
copy: copy:
src: smartjuso.conf src: named.root
dest: /var/named-{{ d['tag'] }}/smartjuso.conf dest: /var/named-{{ d['tag'] }}/named.root
- name: Copy named.local. - name: Copy named.conf.
copy: copy:
src: named.local src: named.conf
dest: /var/named-{{ d['tag'] }}/named.local dest: /etc/named.conf
- name: Copy forward_black.conf. - name: Copy rndc.conf.
copy: copy:
src: forward_black.conf src: rndc.conf
dest: /var/named-{{ d['tag'] }}/forward_black.conf dest: /etc/rndc.conf
- name: Copy rndc.key
copy:
src: rndc.key
dest: /etc/rndc.key
- name: Copy cnsdns.sh. - name: Copy cnsdns.sh.
copy: copy:
src: cnsdns.sh src: cnsdns.sh
dest: /home/cnsdns.sh dest: /home/cnsdns.sh
mode: 0755
- name: Copy named.conf.
copy:
src: named.conf
dest: /etc/named.conf
ignore_errors: True
- name: Check to see if /etc/named.conf exists. - name: Check to see if /etc/named.conf exists.
stat: stat:
...@@ -142,11 +141,27 @@ ...@@ -142,11 +141,27 @@
- name: Change mode of /etc/named.conf - name: Change mode of /etc/named.conf
command: chmod 766 /etc/named.conf command: chmod 766 /etc/named.conf
- name: sed named.conf.
command: sed -i s/named-version/named-{{ d['tag'] }}/g /etc/named.conf
- name: sed cnsdns.sh.
command: sed -i s/named-version/named-{{ d['tag'] }}/g /home/cnsdns.sh
- name: Copy named.service systemd file. - name: Copy named.service systemd file.
copy: copy:
src: named.service src: named.service
dest: /etc/systemd/system/named.service dest: /etc/systemd/system/named.service
- name: Added Cron Job
shell: echo "*/5 * * * * /home/cnsdns.sh" > /var/spool/cron/root
- name: Generate ssh key
user:
name: root
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: Reload systemd. - name: Reload systemd.
command: systemctl daemon-reload command: systemctl daemon-reload
...@@ -162,10 +177,6 @@ ...@@ -162,10 +177,6 @@
- shell: ps -ef | grep named | grep -v grep - shell: ps -ef | grep named | grep -v grep
register: process register: process
- shell: /home/cnsdns.sh
register: cnsdns
ignore_errors: True
{% raw %} {% raw %}
- name: Check named version - name: Check named version
debug: debug:
...@@ -174,8 +185,4 @@ ...@@ -174,8 +185,4 @@
- name: Check named process - name: Check named process
debug: debug:
msg: "check process : '{{ process.stdout }}'" msg: "check process : '{{ process.stdout }}'"
- name: Check rndc script
debug:
msg: "check process : '{{ rndc.stdout }}'"
{% endraw %} {% endraw %}
--- ---
# This playbook deploys BIND # This playbook deploys BIND
- name: Install bind - name: Install bind(Wireless DNS Team)
hosts: all hosts: all
roles: roles:
- daejeonbind - bind-wireless
environment:
http_proxy: http://{{ d['proxy_url'] }}:{{ d['proxy_port'] }}
... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment