My first steps: apt module

182 views
Skip to first unread message

Peter Kaagman

unread,
Jul 24, 2017, 7:48:37 AM7/24/17
to Ansible Project
Hi there group,

I'm making my first baby steps with ansible. After fooling around with ad-hoc command I thought I'd make the steps to playbooks. Looks promissing :D
Ultimate goal is managing my switches, have been playing around with my Ubuntu systems thought. Thought I'd automate my update cyle... wrote a playbook for it (with help from severall posts I found on the web:

---
- hosts: somehost
  tasks
:
   
- name: Update and upgrade
      become
: true
      apt
:
        upgrade
: safe
        update_cache
: yes
        autoremove
: yes


this playbook breaks on the autoremove... and I can't figure out why

PLAY ***************************************************************************

TASK
[setup] *******************************************************************
ok
: [somehost]

TASK
[Update and upgrade] ******************************************************
fatal
: [somehost]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: autoremove"}

PLAY RECAP
*********************************************************************
somehost        
: ok=1    changed=0    unreachable=0    failed=1


When I look at the documentation for the APT module "yes" seems to be a correct vallue for autoremove.

Had a simular issue with "upgrade", but this was resolved by installing "aptitude" on the remote host. Allso made sure I've got "python-apt" installed.

Any help would be apreciated :D

Peter

Dick Davies

unread,
Jul 24, 2017, 7:57:52 AM7/24/17
to ansible list
Old version? http://docs.ansible.com/ansible/latest/apt_module.html says:

"autoremove
(added in 2.1)"
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cbb1e9da-b14b-4d0f-94b1-c47dd038a94b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Peter Kaagman

unread,
Jul 24, 2017, 8:15:59 AM7/24/17
to Ansible Project, di...@hellooperator.net
Hmmm

pkn@chronos-2017:~$ ansible --version
ansible
2.0.0.2
  config file
= /etc/ansible/ansible.cfg
  configured
module search path = Default w/o overrides


Yup :(

Op maandag 24 juli 2017 13:57:52 UTC+2 schreef Dick Davies:

Peter Kaagman

unread,
Jul 24, 2017, 8:42:53 AM7/24/17
to Ansible Project, di...@hellooperator.net
Thanks for your help Dick.... did solve the autoremove issue :D


Op maandag 24 juli 2017 13:57:52 UTC+2 schreef Dick Davies:
Reply all
Reply to author
Forward
0 new messages