Commit 612f7ad3 by Czémán Arnold

Merge branch 'dnsdriver' into 'master'

dnsdriver install

See merge request !15
parents ac4d67ee 5ffa94f4
dnsdriver:
repo_name: https://git.ik.bme.hu/circle/dnsdriver.git
repo_revision: master
dns_db_dir: /var/lib/circle/dnsdriver
address_list: 127.0.0.1
...@@ -11,4 +11,5 @@ base: ...@@ -11,4 +11,5 @@ base:
- firewall - firewall
- manager - manager
- common - common
- dnsdriver
- installer - installer
/var/lib/circle/dnsdriver:
file.directory:
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 755
- makedirs: True
/var/lib/circle/dnsdriver/makefile:
file.managed:
- source: salt://dnsdriver/files/makefile
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 755
/etc/systemd/system/dnscelery.service:
file.managed:
- source: salt://dnsdriver/files/dnscelery.service
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 755
- template: jinja
/home/{{ pillar['user'] }}/.virtualenvs/dnsdriver/bin/postactivate:
file.managed:
- source: salt://dnsdriver/files/postactivate
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 755
- template: jinja
- require:
- virtualenv: virtualenv_dnsdriver
tinydns_conf:
file.managed:
- name: /etc/ndjbdns/tinydns.conf
- source: salt://dnsdriver/files/tinydns.conf
- user: {{ pillar['user'] }}
- group: {{ pillar['user'] }}
- mode: 755
- template: jinja
[Unit]
Description=DNS driver
Wants=network.target
After=network.target
[Service]
User={{ pillar["user"] }}
Group={{ pillar["user"] }}
KillSignal=SIGTERM
TimeoutStopSec=600
Restart=always
WorkingDirectory=/home/{{ pillar["user"] }}/dnsdriver
ExecStart=/bin/bash -c "source /home/{{ pillar["user"] }}/.virtualenvs/dnsdriver/bin/activate; source /home/{{ pillar["user"] }}/.virtualenvs/dnsdriver/bin/postactivate; exec celery -A dnscelery worker --loglevel=info -n $(/bin/hostname -s).dns"
[Install]
WantedBy=multi-user.target
default:
tinydns-data
export AMQP_URI=amqp://{{ pillar['amqp']['user'] }}:{{ pillar['amqp']['password'] }}@{{ pillar['amqp']['host'] }}:{{ pillar['amqp']['port'] }}/{{ pillar['amqp']['vhost'] }}
export DNS_DB_DIR={{ pillar['dnsdriver']['dns_db_dir'] }}
# extra paramaters for dnscelery
#export EXTRA=
#
# tinydns.conf: this file is part of the djbdns project.
#
# Here we define some variables vital for running tinydns.
#
# Things to remember:
#
# - Lines starting with `#' are comments, thus ignored.
# - Blank lines are blank, thus ignored.
# - Do not leave blank spaces around `=' sign while defining a variable.
#
# Maximum number of bytes that could be allocated if required.
#
DATALIMIT=300000
# No of bytes to allocate for the cache. This may not exceed DATALIMIT
#
# CACHESIZE=100000
# Address to listen on for incoming connections. It could be comma separated
# list of IP addresses.
#
# IP=127.0.0.1[,x.x.x.x,...]
#
IP={{ pillar['dnsdriver']['address_list'] }}
# Address to use while sending out-going requests. 0.0.0.0 means machines
# primary IP address.
#
# IPSEND=0.0.0.0
# A non-root user whose privileges should be acquired by tinydns.
# Default: daemon
# See: $ id -u daemon
#
UID=2
# A non-root group whose privileges should be acquired by tinydns.
# Default: daemon
# See: $ id -g daemon
#
GID=2
# ROOT: is the new root & working directory for tinydns.
# Obviously, the user whose ID is mentioned above MUST be able to read from
# this directory.
#
# Also, this is where `data' and `data.cdb' files should reside.
#
ROOT={{ pillar['dnsdriver']['dns_db_dir'] }}
# If HIDETTL is set, tinydns always uses a TTL of 0 in its responses.
#
# HIDETTL=
# If FORWARDONLY is set, tinydns treats the servers/roots as a list of IP
# addresses for other caches, not root servers. It forwards queries to those
# caches the same way a client does, rather than contacting a chain of servers
# according to NS records.
#
# FORWARDONLY=
# If DEBUG_LEVEL is set, tinydns displays helpful debug messages to
# the console.
#
DEBUG_LEVEL=1
include:
- common
gitrepo_dnsdriver:
git.latest:
- name: {{ pillar['dnsdriver']['repo_name'] }}
- rev: {{ pillar['dnsdriver']['repo_revision'] }}
- target: /home/{{ pillar['user'] }}/dnsdriver
- user: {{ pillar['user'] }}
- require:
- pkg: git
include:
- dnsdriver.gitrepo
- dnsdriver.virtualenv
- dnsdriver.configuration
dnsdriver:
pkg.installed:
- pkgs:
- ndjbdns
- make
- python-virtualenvwrapper
- require_in:
- virtualenv: virtualenv_dnsdriver
- file: tinydns_conf
dnscelery:
service.running:
- enable: True
- watch:
- pkg: dnsdriver
- sls: dnsdriver.gitrepo
- sls: dnsdriver.virtualenv
- sls: dnsdriver.configuration
tinydns:
service.running:
- enable: True
- watch:
- pkg: dnsdriver
- sls: dnsdriver.gitrepo
- sls: dnsdriver.virtualenv
- sls: dnsdriver.configuration
virtualenv_dnsdriver:
virtualenv.managed:
- name: /home/{{ pillar['user'] }}/.virtualenvs/dnsdriver
- requirements: /home/{{ pillar['user'] }}/dnsdriver/requirements.txt
- user: {{ pillar['user'] }}
- no_chown: true
- require:
- git: gitrepo_dnsdriver
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