main.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. - name: Set OliveTin package Name
  3. ansible.builtin.set_fact:
  4. olivetin: OliveTin_linux_amd64.{{ 'deb' if ansible_os_family == "Debian" else 'rpm' }}
  5. - name: Check for existing OliveTin package
  6. ansible.builtin.stat:
  7. path: /root/{{ olivetin }}
  8. register: olivetin_pkg
  9. - name: Download OliveTin Package
  10. ansible.builtin.get_url:
  11. url: https://github.com/OliveTin/OliveTin/releases/latest/download/{{ olivetin }}
  12. dest: /root/{{ olivetin }}
  13. when:
  14. - olivetin_pkg.stat.exists == False
  15. - name: Install OliveTin (Debian)
  16. ansible.builtin.apt:
  17. deb: /root/{{ olivetin }}
  18. state: present
  19. when:
  20. - ansible_os_family == "Debian"
  21. - name: Install OliveTin (Fedora/CentOS)
  22. ansible.builtin.dnf:
  23. name: /root/{{ olivetin }}
  24. state: present
  25. when:
  26. - ansible_os_family == "RedHat"
  27. - name: Configure OliveTin
  28. ansible.builtin.copy:
  29. src: config.yaml_{{ ansible_hostname }}
  30. dest: /etc/OliveTin/config.yaml
  31. owner: root
  32. group: root
  33. mode: '0644'
  34. notify: Restart OliveTin
  35. - name: Start/Enable OliveTin
  36. ansible.builtin.systemd_service:
  37. name: OliveTin
  38. state: started
  39. enabled: yes