Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

'__unattended_origins_patterns' is undefined error #16

Closed
Yannik opened this issue Feb 17, 2016 · 1 comment
Closed

'__unattended_origins_patterns' is undefined error #16

Yannik opened this issue Feb 17, 2016 · 1 comment

Comments

@Yannik
Copy link
Contributor

Yannik commented Feb 17, 2016

Hi,

I am trying to use your play with the default settings (install security updates but nothing else) like this:

- hosts: all
  roles:
    - role: jnv.unattended-upgrades
      unattended_mail: "user@example.org"

However, I am getting this failure when running it:

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

TASK [setup] *******************************************************************
ok: [127.0.0.1]

TASK [jnv.unattended-upgrades : install unattended-upgrades] *******************
ok: [127.0.0.1]

TASK [jnv.unattended-upgrades : install reboot dependencies] *******************
skipping: [127.0.0.1]

TASK [jnv.unattended-upgrades : create APT auto-upgrades configuration] ********
ok: [127.0.0.1]

TASK [jnv.unattended-upgrades : create unattended-upgrades configuration] ******
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: ERROR! '__unattended_origins_patterns' is undefined"}

PLAY RECAP *********************************************************************
127.0.0.1               : ok=3    changed=0    unreachable=0    failed=1

Information about the system I am running this on:

$ ansible --version
ansible 2.0.0.2
  config file = 
  configured module search path = Default w/o overrides
$ cat /etc/debian_version 
8.3
$ cat /etc/issue
Debian GNU/Linux 8 \n \l
$ cat /etc/ansible/roles/jnv.unattended-upgrades/meta/.galaxy_install_info 
{install_date: 'Wed Feb 17 10:14:56 2016', version: v1.1.1}

Any idea how to fix this?

@Yannik
Copy link
Contributor Author

Yannik commented Feb 17, 2016

I found the issue:
I was running the playbook using --tags unattended.
The problem is, that the task adding the distribution-specific variables is missing the tag unattended: https://github.com/jnv/ansible-role-unattended-upgrades/blob/master/tasks/main.yml#L2

@jnv jnv closed this as completed in 9009e00 Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant