- become: yes block: - name: add ppa [Ubuntu] when: ansible_distribution == "Ubuntu" apt_repository: repo: ppa:mjasnik/ppa - name: install timekpr [Ubuntu] when: ansible_distribution == "Ubuntu" apt: update_cache: yes state: latest pkg: - timekpr-next - name: install timekpr [Arch] shell: cmd: yay -S --needed --noconfirm timekpr-next when: ansible_distribution == "Archlinux" - name: configure template: src: var/lib/timekpr/config/timekpr.USER.conf.j2 dest: /var/lib/timekpr/config/timekpr.{{ansible_user_id}}.conf vars: user: "{{ ansible_user_id }}" - name: "Enable service" become: yes ansible.builtin.systemd: name: timekpr state: started enabled: yes