From fb30ce6ecd83514fc25811171cc838038093e79f Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 15 Aug 2020 13:58:09 +0200 Subject: [PATCH] Adapt knot role --- roles/vavrusa.knot/README.md | 8 ---- roles/vavrusa.knot/defaults/main.yml | 2 - roles/vavrusa.knot/tasks/from_source.yml | 54 ------------------------ roles/vavrusa.knot/tasks/main.yml | 4 -- roles/vavrusa.knot/vars/main.yml | 2 - 5 files changed, 70 deletions(-) delete mode 100644 roles/vavrusa.knot/tasks/from_source.yml delete mode 100644 roles/vavrusa.knot/vars/main.yml diff --git a/roles/vavrusa.knot/README.md b/roles/vavrusa.knot/README.md index c4e4f39..edb57e0 100644 --- a/roles/vavrusa.knot/README.md +++ b/roles/vavrusa.knot/README.md @@ -11,14 +11,6 @@ None. 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. knot_install_dir: /usr/local diff --git a/roles/vavrusa.knot/defaults/main.yml b/roles/vavrusa.knot/defaults/main.yml index 4beef60..fa4d67b 100644 --- a/roles/vavrusa.knot/defaults/main.yml +++ b/roles/vavrusa.knot/defaults/main.yml @@ -1,7 +1,5 @@ --- ## Installation options -knot_from_source: false -knot_git_branch: master knot_install_dir: "" knot_user: knot knot_group: knot diff --git a/roles/vavrusa.knot/tasks/from_source.yml b/roles/vavrusa.knot/tasks/from_source.yml deleted file mode 100644 index f97c8e3..0000000 --- a/roles/vavrusa.knot/tasks/from_source.yml +++ /dev/null @@ -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" diff --git a/roles/vavrusa.knot/tasks/main.yml b/roles/vavrusa.knot/tasks/main.yml index 39f6ca4..4caf50d 100644 --- a/roles/vavrusa.knot/tasks/main.yml +++ b/roles/vavrusa.knot/tasks/main.yml @@ -1,10 +1,6 @@ --- -- name: install from source - include: from_source.yml - when: knot_from_source - name: install from packages include: from_pkgs.yml - when: not knot_from_source # Post-install - name: set config path (FreeBSD) diff --git a/roles/vavrusa.knot/vars/main.yml b/roles/vavrusa.knot/vars/main.yml deleted file mode 100644 index 7342169..0000000 --- a/roles/vavrusa.knot/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for knot.auth