--- - name: Container Setup vars: lxc_base: ansible-alpine3.11 lxc_name: test import_playbook: ../common/tasks/lxc.yml - name: Installing GoAccess hosts: test vars_files: - ../variables.yml tasks: - name: Ensuring group exists group: name: "{{ goaccess_user }}" state: present - name: Creating user and making home directory user: system: yes state: present name: "{{ goaccess_user }}" groups: "{{ goaccess_user }}" home: "{{ goaccess_home }}" - name: Installing the required dependencies apk: state: present update_cache: yes name: - sudo - git - supervisor - tar - autoconf - automake - gcc - g++ - libmaxminddb-dev - gettext-dev - ncurses-dev - openssl-dev - make - block: - name: Cloning repository git: repo: "{{ goaccess_repository }}" dest: "{{ goaccess_home }}" version: "{{ goaccess_version }}" force: yes - name: Creating configuration shell: autoreconf -fiv args: chdir: "{{ goaccess_home }}" creates: configure - name: Configuring application shell: ./configure --enable-utf8 --enable-geoip=mmdb --with-openssl args: chdir: "{{ goaccess_home }}" creates: config.status - name: Compiling application shell: make args: chdir: "{{ goaccess_home }}" creates: goaccess - name: Creating directories file: path: "{{ goaccess_home }}/{{ item }}" state: directory with_items: - public - database - database/geoip - name: Downloading referrer spam list get_url: url: https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt dest: "{{ goaccess_home }}/config" mode: '0644' - name: Downloading GeoLite2 city database get_url: url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key={{ maxmind_geoip2_key }}&suffix=tar.gz" dest: "{{ goaccess_home }}/database/geoip/geolite2-city.tar.gz" mode: '0644' - name: Extracting GeoLite2 city database shell: tar -xf geolite2-city.tar.gz --strip 1 args: chdir: "{{ goaccess_home }}/database/geoip" creates: config.status warn: false changed_when: false - name: Placing configuration files template: src: "templates/{{ item | basename }}.j2" dest: "{{ goaccess_home }}/{{ item }}" with_items: - public/favicon.ico - config/goaccess.conf - config/browsers.list become: true become_user: "{{ goaccess_user }}" - name: Copying supervisord config files template: src: "templates/{{ item | basename }}.j2" dest: "{{ item }}" with_items: - /etc/supervisord.conf - name: Ensuring supervisord has been started and enabled service: name: supervisord state: restarted enabled: yes changed_when: false - name: Waiting for supervisor to become active wait_for: port: 9100