Ansible roles by Evolix
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.
 
 
 
 
 
 

46 lines
1.0 KiB

  1. ---
  2. - name: No backports config in default sources.list
  3. lineinfile:
  4. dest: /etc/apt/sources.list
  5. regexp: "backports"
  6. state: absent
  7. tags:
  8. - apt
  9. - name: Backports sources list is installed
  10. template:
  11. src: '{{ ansible_distribution_release }}_backports.list.j2'
  12. dest: /etc/apt/sources.list.d/backports.list
  13. force: yes
  14. mode: "0640"
  15. register: apt_backports_list
  16. tags:
  17. - apt
  18. - name: Backports configuration
  19. copy:
  20. src: '{{ ansible_distribution_release }}_backports_preferences'
  21. dest: /etc/apt/preferences.d/0-backports-defaults
  22. force: yes
  23. mode: "0640"
  24. register: apt_backports_config
  25. tags:
  26. - apt
  27. - name: Archived backport are accepted (jessie)
  28. lineinfile:
  29. dest: '/etc/apt/apt.conf.d/99no-check-valid-until'
  30. line: 'Acquire::Check-Valid-Until no;'
  31. create: yes
  32. state: present
  33. when: ansible_distribution_release == "jessie"
  34. tags:
  35. - apt
  36. - name: Apt update
  37. apt:
  38. update_cache: yes
  39. when: apt_backports_list | changed or apt_backports_config | changed
  40. tags:
  41. - apt