--- - when: crowdsec_install_mode != 'none' block: - name: Download crowdsec get_url: url: "{{ crowdsec_archive_url }}" dest: /tmp/ checksum: sha1:{{ crowdsec_archive_sha1 }} - name: Extract crowdsec unarchive: src: /tmp/crowdsec-release.tgz dest: /tmp/ remote_src: True - name: Install or upgrade crowdsec command: ./wizard.sh --bin{{ crowdsec_install_mode }} args: chdir: /tmp/crowdsec-v{{ crowdsec_version }}/ notify: restart crowdsec - name: Update crowdsec hub command: cscli hub update tags: crowdsec - name: Create the systemd unit snippet dir file: path=/etc/systemd/system/crowdsec.service.d state=directory tags: crowdsec - name: Make the service restart on failure copy: content: | [Service] Restart=on-failure StartLimitInterval=0 RestartSec=30 dest: /etc/systemd/system/crowdsec.service.d/restart.conf register: crodwsec_unit notify: restart crowdsec tags: crowdsec - name: Reload systemd systemd: daemon_reload=True when: crodwsec_unit.changed tags: crowdsec - name: Install pre and post backup hooks template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/crowdsec mode=700 loop: - pre - post tags: crowdsec