Commit 1fbb9dcf by Your Name

* Updated setup file for daejeon lguplus

 - added playbook for daejeon install bind pkg
 - modified uxenos svc interface template file for bonding
 - modified grub serial console jessie, uxenos
 - modified shellinaboxd absolute path in bizlogic.py
parent d1f36ba9
---
# This playbook deploys BIND
- name: Ensure the 'Developemnt tools' package group installed.
yum:
name: "@Development tools"
state: present
- name: Ensure the openssl-devel package installed
yum:
name: openssl-devel
state: present
- name: Ensure the bind-utils package installed
yum:
name: bind-utils
state: present
- name: Get bind source tarball from ftp://ftp.isc.org.
get_url:
url: http://ftp.isc.org/isc/bind9/{{ d['tag'] }}/bind-{{ d['tag'] }}.tar.gz
dest: /home/bind-{{ d['tag'] }}.tar.gz
- name: untar the source tarball to managed node's /tmp.
unarchive:
src: /home/bind-{{ d['tag'] }}.tar.gz
dest: /home
remote_src: True
- name: configure bind.
shell: ./configure --prefix=/var/named-{{ d['tag'] }} --with-openssl=/usr --sysconfdir=/etc --enable-ipv6 --enable-threads
args:
chdir: /home/bind-{{ d['tag'] }}
- name: make bind.
shell: make -j {{ ansible_processor_vcpus }}
args:
chdir: /home/bind-{{ d['tag'] }}
- name: make install bind.
shell: make install
args:
chdir: /home/bind-{{ d['tag'] }}
- name: Clean untarred source
file:
path: /home/bind-{{ d['tag'] }}
state: absent
- name: Create named user.
user:
name: named
shell: /sbin/nologin
createhome: no
- name: Check if named is running.
command: pidof named
register: is_named_running
ignore_errors: True
- name: kill named process
shell: kill -9 $(pidof named)
when: is_named_running.rc == 0
- name: Delete /usr/sbin/named.
file:
path: /usr/sbin/named
state: absent
ignore_errors: True
- name: Delete /usr/sbin/rndc.
file:
path: /usr/sbin/rndc
state: absent
ignore_errors: True
- name: Symlink named.
file:
src: /var/named-{{ d['tag'] }}/sbin/named
dest: /usr/sbin/named
state: link
- name: Symlink rndc.
file:
src: /var/named-{{ d['tag'] }}/sbin/rndc
dest: /usr/sbin/rndc
state: link
- name: Make directory forward/black.
file:
path: /var/named-{{ d['tag'] }}/forward/black
state: directory
mode: 0755
- name: Copy xx.com.
copy:
src: xx.com
dest: /var/named-{{ d['tag'] }}/forward/black/
- name: Copy smartjuso.conf.
copy:
src: smartjuso.conf
dest: /var/named-{{ d['tag'] }}/smartjuso.conf
- name: Copy named.local.
copy:
src: named.local
dest: /var/named-{{ d['tag'] }}/named.local
- name: Copy forward_black.conf.
copy:
src: forward_black.conf
dest: /var/named-{{ d['tag'] }}/forward_black.conf
- name: Copy cnsdns.sh.
copy:
src: cnsdns.sh
dest: /home/cnsdns.sh
- name: Copy named.conf.
copy:
src: named.conf
dest: /etc/named.conf
ignore_errors: True
- name: Check to see if /etc/named.conf exists.
stat:
path: /etc/named.conf
register: st
- name: Touch /etc/named.conf if not exist.
file:
path: /etc/named.conf
state: touch
when: st.stat.exists == False
- name: Change ownership of /var/named-{{ d['tag'] }} to named:named
command: chown -R named:named /var/named-{{ d['tag'] }}
- name: Change mode of /var/named-{{ d['tag'] }}
command: chmod 744 /var/named-{{ d['tag'] }}
- name: Change mode of /etc/named.conf
command: chmod 766 /etc/named.conf
- name: Copy named.service systemd file.
copy:
src: named.service
dest: /etc/systemd/system/named.service
- name: Reload systemd.
command: systemctl daemon-reload
- name: Enable named service.
command: systemctl enable named.service
- name: Run named service.
command: systemctl start named.service
- shell: named -v
register: version
- shell: ps -ef | grep named | grep -v grep
register: process
- shell: /home/cnsdns.sh
register: cnsdns
ignore_errors: True
{% raw %}
- name: Check named version
debug:
msg: "bind version : '{{ version.stdout }}'"
- name: Check named process
debug:
msg: "check process : '{{ process.stdout }}'"
- name: Check rndc script
debug:
msg: "check process : '{{ rndc.stdout }}'"
{% endraw %}
---
# This playbook deploys BIND
- name: Install bind
hosts: all
roles:
- daejeonbind
...
default porch-generated
label porch-generated
kernel {{ data['fai_kernel_url'] }}
append initrd={{ data['fai_initrd_url'] }} ip=dhcp root=live:{{ data['fai_squash_url'] }} aufs FAI_FLAGS=verbose,sshd,reboot FAI_CONFIG_SRC={{ data['fai_config_url'] }} FAI_ACTION=install {% if data['type'] == 'PM' %} console=tty0 console=ttyS0,115200n8 {% endif %} net.ifnames=0 edd=off
auto {{ d['svc_nic'] }} {% set nics = d['svc_nic'].split() %}
iface {{ d['svc_nic'] }} inet static
{% if nics|length > 1 %}
{% for nic in nics %}
allow-hotplug {{ nic }}
iface {{ nic }} inet manual
{% endfor %}
auto bond1
iface bond1 inet manual
slaves {{ d['svc_nic'] }}
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
auto xenbr1
iface xenbr1 inet static
bridge_ports bond1
bridge_maxwait 5
address {{ d['svc_ip'] }} address {{ d['svc_ip'] }}
netmask {{ d['svc_netmask'] }} netmask {{ d['svc_netmask'] }}
gateway {{ d['svc_gateway'] }} gateway {{ d['svc_gateway'] }}
{% else %}
auto xenbr1
iface xenbr1 inet static
bridge_ports {{ nics|first }}
bridge_maxwait 5
address {{ d['svc_ip'] }}
netmask {{ d['svc_netmask'] }}
gateway {{ d['svc_gateway'] }}
{% endif %}
auto {{ d['svc_nic'] }}
iface {{ d['svc_nic'] }} inet static
address {{ d['svc_ip'] }}
netmask {{ d['svc_netmask'] }}
gateway {{ d['svc_gateway'] }}
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