Skip to content

unattended-upgrades must always be installed #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

filnko
Copy link
Contributor

@filnko filnko commented Mar 3, 2017

removed detection of init system.
the package unattended-upgrades needs to be always installed regardless of init system.

@Voronenko
Copy link
Contributor

Perhaps I would explain about init systems detection:

root@automaticupdates:~# cat /etc/lsb-release | head -2
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
root@automaticupdates:~# ls /etc/systemd/system/apt-daily.timer.d/
ls: cannot access /etc/systemd/system/apt-daily.timer.d/: No such file or directory
root@automaticupdates:~# 

Currently yes, role targets only xenial with systemd magic.
But in nearest plans there is also to support classic ubuntu 14.04 , at least until end of support.

Thus, I would propose leave init system detection

@filnko
Copy link
Contributor Author

filnko commented Mar 6, 2017

ok, in that case it makes sense.
ansible already provides the init system in the variable {{ ansible_service_mgr }}, so theres no need to detect it yourself.

also unattended-upgrades must be installed always because it doesn't work on systemd otherwise.

@Voronenko
Copy link
Contributor

Voronenko commented Mar 6, 2017

@filnko Yep, I know also more often study gather_facts output.

I.e. I first wrote detection, later discovered variable. But as a lot of roles re-use recipe, use it historically
But it is now ansible_service_mgr for unknown cases/

---
  - name: USE | Detect upstart system
    shell: |
      if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart;
      elif [[ `systemctl` =~ -\.mount ]]; then echo systemd;
      elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then echo sysv-init;
      else echo {{ansible_service_mgr | default('UNKNOWN')}};
      fi
    become: yes
    args:
      executable: /bin/bash
    register: upstart_detect_raw
    changed_when: False

  - set_fact:
      upstart_system: "{{upstart_detect_raw.stdout}}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants