Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.5 KiB

  1. - name: install kodi-repository packages
  2. apt:
  3. name: "{{ item }}"
  4. state: present
  5. update_cache: yes
  6. cache_valid_time: 3600
  7. install_recommends: '{{ install_recommends | default("no") }}'
  8. with_items:
  9. - python-git
  10. - name: download create_repository script
  11. get_url:
  12. url: https://raw.githubusercontent.com/chadparry/kodi-repository.chad.parry.org/master/tools/create_repository.py
  13. dest: /root/create_repository.py
  14. mode: 0540
  15. - name: create kodi-repository directory
  16. file:
  17. path: '/srv/{{ repository_folder }}/{{ item }}'
  18. state: directory
  19. owner: www-data
  20. group: www-data
  21. mode: 0755
  22. with_items:
  23. - ''
  24. - 'repository-addon'
  25. - stat:
  26. path: '/srv/kodi-repository/addons.xml'
  27. checksum_algorithm: sha256
  28. register: repository_folder_md5
  29. - name: upload repository addon xml
  30. template:
  31. src: addon.xml.j2
  32. dest: "/srv/{{ repository_folder }}/repository-addon/addon.xml"
  33. - name: generate kodi repository
  34. command: '/root/create_repository.py http://projects.lilik.it/kaos.lilik.it/kodi-trakt-plugin.git /srv/{{ repository_folder }}/repository-addon'
  35. args:
  36. chdir: "/srv/{{ repository_folder }}"
  37. changed_when: False
  38. - name: check if repository has been changed
  39. stat:
  40. path: '/srv/kodi-repository/addons.xml'
  41. checksum_algorithm: sha256
  42. register: repository_folder_md5_2
  43. changed_when: "'checksum' not in repository_folder_md5['stat'] or repository_folder_md5['stat']['checksum'] != repository_folder_md5_2['stat']['checksum']"