Skip to content

Ansible: Use errors="ignore" instead of skip

Another Ansible upgrade deprecation warning, which appears in Ansible 2.8:

TASK [send email] *************************************************************************************************************************************************************************************************************************************************************
[DEPRECATION WARNING]: Use errors="ignore" instead of skip. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

Found so many in the last time that I added a new Tag: Deprecation.

 

Continue reading "Ansible: Use errors="ignore" instead of skip"

_ansible_item_label changes in Ansible 2.8

The Ansible 2.8 upgrade brought a few failing Playbooks. I ran into the following error:

TASK [Demo Task] ************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute '_ansible_item_label'\n\nThe error appears to be in '/path/to/ansible/playbook.yml': line 76, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: Demo Task\n    ^ here\n"}

Well, seems like another upgrade with another major change. Don't you like that?

 

Continue reading "_ansible_item_label changes in Ansible 2.8"

Ansible: TRANSFORM_INVALID_GROUP_CHARS deprecation warning

After upgrading Ansible to version 2.8.3, the following deprecation warning appeared many times:

[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
 [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

Wow, previously valid names in my hosts.cfg file are soon invalid? What's going on here?

 

Continue reading "Ansible: TRANSFORM_INVALID_GROUP_CHARS deprecation warning"

Ansible: "apt" module and loops

After upgrading Ansible to version 2.8.3, the "apt" module started spitting out deprecation warnings:

TASK [common : basic packages] ***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use `name: ['vim', 'screen', 'rsync']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [hostname] => (item=['vim', 'screen', 'rsync'])

 

 

Continue reading "Ansible: "apt" module and loops"