[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Ansible APT install prob ...



Building a new VM yesterday ... hoped to reuse most of my ansible
tasks/vars/templates to make it fast.  Running ansible v1.9.2 pulled from
github. It was current about 6-8 weeks ago.

Ran into an issue with the APT package installation task.  This task has been
working for over a year - no issues previously.  Ansible uses yaml ...

---

- name: Install Base Server Pkgs
  action: apt pkg={{ item }} state=installed
  with_items:
      - acpid
      - update-notifier-common
      - openssh-server
      - iptables-persistent
      - aptitude
      - sysstat
      - ethtool
      - fail2ban
      - rsync
      - rdiff-backup
      - mlocate
      - glances
      - software-properties-common
      - logwatch
      - lshw
      - ntp
      - tree
      - postfix
      - heirloom-mailx

# End of file
# ########################################################

The error:

TASK: [Install Base Server Pkgs] **********************************************
failed: [pxe] =>
(item=acpid,update-notifier-common,openssh-server,iptables-persistent,aptitude,sysstat,ethtool,fail2ban,rsync,rdiff-backup,mlocate,glances,software-properties-common,logwatch,lshw,ntp,tree,postfix,heirloom-mailx)
=> {"cmd": "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical
/usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o
Dpkg::Options::=--force-confold install glances", "failed": true, "item":
"acpid,update-notifier-common,openssh-server,iptables-persistent,aptitude,sysstat,ethtool,fail2ban,rsync,rdiff-backup,mlocate,glances,software-properties-common,logwatch,lshw,ntp,tree,postfix,heirloom-mailx",
"rc": 2}
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed -- aborting

# ########################################################

Fine ... ran out of time, so I manually installed all the packages yesterday.
Then came back to it this morning to troubleshoot. Reran the playbook - no
errors.  Fine - but all the packages were installed this time.  remove "glances"
- rerun, get the same error.

Next step is to shorten the list of packages ... remove 15 of them, leaving
glances ... same error.  Perhaps it is the package?  remove heirloom-mailx ...
same error.  Get down to 1 package in the list - just heirloom-mailx - same
error.  What?
#####
---

- name: Install Base Server Pkgs
  action: apt pkg={{ item }} state=installed
  with_items:
      - heirloom-mailx
####

Turn up the logging ... get the exact command that ansible is running ...

$ sudo DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get
-y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install
heirloom-mailx

Run that on the remote system - it works. Huh? What?  Rerun the playbook - it
works - well, the package was installed. Remove it again, rerun the playbook -
fails. Same error.

Since the APT package is so old and so very central to Ansible, I assume it is
something I'm doing wrong or a short-lived issue in ansible.... github and grab
v1.9.2-1 (released 4 days ago).  Try again. Same error, in the same place.

So ... I'm stuck and need to ask my ALE friends. Hopefully it is something trivial.

TIA!