From a5c3d832bcc052387ba1002c851f41b1eb9db166 Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 11 Dec 2020 02:19:52 +0100 Subject: [PATCH] Add installation for goaccess --- README.md | 7 +++++-- defaults/main.yml | 2 ++ tasks/installation.yml | 28 ++++++++++++++++++++++++++++ tasks/main.yml | 2 ++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 tasks/installation.yml diff --git a/README.md b/README.md index f31399a..06e6118 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# ansible_role_template -Template for Ansible roles + ansible role goaccess +=========================== +Ansible roles to install [goaccess](https://github.com/allinurl/goaccess.git) at Debian/Ubuntu systems. + +**UNDER DEVELOPEMENT** Testing ---------- diff --git a/defaults/main.yml b/defaults/main.yml index c8d9a89..26bc571 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,5 @@ --- +goaccess__state: present + # should we do a version check? (recomended) submodules_versioncheck: false diff --git a/tasks/installation.yml b/tasks/installation.yml new file mode 100644 index 0000000..ecf6ee4 --- /dev/null +++ b/tasks/installation.yml @@ -0,0 +1,28 @@ +--- +- name: install apt-transport-https for secure repo + become: true + apt: + name: apt-transport-https + state: "{{ goaccess__state }}" + update_cache: yes + +- name: add goaccess apt_repository + become: true + apt_repository: + repo: "deb https://deb.goaccess.io/ {{ ansible_distribution_release | lowercase }} main" + state: present + filename: goaccess + +- name: add goaccess apt_key + become: true + apt_key: + url: https://deb.goaccess.io/gnugpg.key + state: present + +- name: install goaccess + become: true + apt: + name: goaccess + state: "{{ goaccess__state }}" + update_cache: yes + cache_valid_time: 3600 diff --git a/tasks/main.yml b/tasks/main.yml index b37444c..f73f7d3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,5 @@ --- - include_tasks: versioncheck.yml when: submodules_versioncheck|bool + +- include_tasks: installation.yml