Adapt knot role

This commit is contained in:
Nemo 2020-08-15 13:58:09 +02:00
parent 109cf859ab
commit fb30ce6ecd
5 changed files with 0 additions and 70 deletions

View file

@ -11,14 +11,6 @@ None.
Role Variables Role Variables
-------------- --------------
Available variables are listed below, along with default values (see `defaults/main.yml`):
knot_from_source: false # Default
Set either of this to `true` or `false` to choose installation from sources or distribution packages.
knot_git_branch: master
If building from sources, pick a git branch or tag. If building from sources, pick a git branch or tag.
knot_install_dir: /usr/local knot_install_dir: /usr/local

View file

@ -1,7 +1,5 @@
--- ---
## Installation options ## Installation options
knot_from_source: false
knot_git_branch: master
knot_install_dir: "" knot_install_dir: ""
knot_user: knot knot_user: knot
knot_group: knot knot_group: knot

View file

@ -1,54 +0,0 @@
---
# Fetch dependencies (platform-specific)
- name: install dependencies
apt: pkg={{ item }} update_cache=yes cache_valid_time=86400 state=present
loop:
- gcc
- make
- libc6-dev
- libtool
- autoconf
- liburcu-dev
- libgnutls28-dev
- libjansson-dev
when: ansible_os_family == "Debian"
- name: dependencies (FreeBSD)
pkgng: name={{ item }} state=present
loop:
- security/nettle
- security/gnutls
- devel/jansson
- sysutils/liburcu
- databases/lmdb
when: ansible_os_family == "FreeBSD"
# Clone and build from sources
- name: git clone
git: repo=http://gitlab.labs.nic.cz/labs/knot.git dest=/usr/local/src/knot version={{ knot_git_branch }} update=yes
- name: configure
shell: autoreconf -if && ./configure --prefix={{ knot_install_dir }} chdir=/usr/local/src/knot creates=/usr/local/src/knot/Makefile
- name: build
command: make -j{{ansible_processor_count}} chdir=/usr/local/src/knot creates=/usr/local/src/knot/src/knotd
- name: install
command: make install chdir=/usr/local/src/knot creates={{ knot_install_dir }}/sbin/knotd
# Post-installation
- name: add knot group
group:
name={{ knot_group }}
comment="Knot DNS"
- name: add knot user
user:
name={{ knot_user }}
comment="Knot DNS"
home={{ knot_install_dir }}
shell=/bin/false
groups={{knot_group}}
system=yes
- name: make sure directories are writeable
file: path={{ item }} state=directory owner={{ knot_user }}
with_items:
- "{{ knot_install_dir }}/etc/knot"
- "{{ knot_install_dir }}/var/lib/knot"
- "{{ knot_install_dir }}/var/run/lib/knot"

View file

@ -1,10 +1,6 @@
--- ---
- name: install from source
include: from_source.yml
when: knot_from_source
- name: install from packages - name: install from packages
include: from_pkgs.yml include: from_pkgs.yml
when: not knot_from_source
# Post-install # Post-install
- name: set config path (FreeBSD) - name: set config path (FreeBSD)

View file

@ -1,2 +0,0 @@
---
# vars file for knot.auth