--- - name: check if prometheus apt component of spreadspace repo is enabled assert: msg: "please enable the 'prometheus' component of spreadspace repo using 'spreadspace_apt_repo_components'" that: - spreadspace_apt_repo_components is defined - "'prometheus' in spreadspace_apt_repo_components" - name: generate apt pin file for sachet package when: sachet_version is defined copy: dest: "/etc/apt/preferences.d/sachet.pref" content: | Package: sachet Pin: version {{ sachet_version }}-1 Pin-Priority: 1001 - name: remove apt pin file for sachet package when: sachet_version is not defined file: path: "/etc/apt/preferences.d/sachet.pref" state: absent - name: install apt packages apt: name: "sachet{% if sachet_version is defined %}={{ sachet_version }}-1{% endif %}" state: present allow_downgrade: yes notify: restart sachet - name: add user for sachet user: name: sachet system: yes home: /nonexistent create_home: no - name: install and configure smstools when: "'smstools' in sachet_providers" include_tasks: smstools.yml - name: generate configuration file template: src: sachet.yml.j2 dest: /etc/sachet.yml owner: sachet mode: 0600 notify: restart sachet - name: generate systemd service unit template: src: sachet.service.j2 dest: /etc/systemd/system/sachet.service notify: restart sachet - name: make sure sachet is enabled and started systemd: name: sachet.service daemon_reload: yes state: started enabled: yes