---
#FIXME: these tasks are executed each time:
- name: Disable update-manager and notifier
  command: "gsettings set {{ item }}"
  when: has_editors_other_than_emacs
  with_items:
    - com.ubuntu.update-notifier no-show-notifications true
    - com.ubuntu.update-notifier regular-auto-launch-interval 999 # days
    - com.ubuntu.update-notifier show-apport-crashes false
    - com.ubuntu.update-manager check-dist-upgrades false
  tags: legacy
- name: Disable update-manager and notifier on Ubuntu 12.04
  command: "gsettings set {{ item }}"
  when: has_editors_other_than_emacs
  with_items:
    - com.ubuntu.update-notifier auto-launch false
    - com.ubuntu.update-notifier hide-reboot-notification true
  when: ansible_distribution_release == 'precise'
  tags: legacy
- name: Kill update-notifier
  command: killall update-notifier
  tags: legacy
  ignore_errors: yes

- name: Install ts via APT
  apt:
    name: moreutils
  become: yes
  become_method: sudo

---
- name: Install packages via APT
  apt:
    name: "{{ item }}"
  become: yes
  become_method: sudo
  with_items:
    # These are dependencies of lubuntu-desktop anyway but we need them already now for the next
    # plays:
    - update-notifier # in order to disable it
    - libglib2.0-bin # for gsettings

#FIXME: these tasks are executed each time:
- name: Disable update-manager and notifier
  command: "gsettings set {{ item }}"
  when: has_editors_other_than_emacs
  with_items:
    - com.ubuntu.update-notifier no-show-notifications true
    - com.ubuntu.update-notifier regular-auto-launch-interval 999 # days
    - com.ubuntu.update-notifier show-apport-crashes false
    - com.ubuntu.update-manager check-dist-upgrades false
  tags: legacy
- name: Disable update-manager and notifier on Ubuntu 12.04
  command: "gsettings set {{ item }}"
  when: has_editors_other_than_emacs
  with_items:
    - com.ubuntu.update-notifier auto-launch false
    - com.ubuntu.update-notifier hide-reboot-notification true
  when: ansible_distribution_release == 'precise'
  tags: legacy
- name: Kill update-notifier
  command: killall update-notifier
  tags: legacy
  ignore_errors: yes

- name: Install ts via APT
  apt:
    name: moreutils
  become: yes
  become_method: sudo

Fix update-notifier's disabling on first rollout.
Fix update-notifier's disabling on first rollout.
