[openstack-dev] [tripleo] [tripleo-validations] using using top-level fact vars will deprecated in future Ansible versions

Cédric Jeanneret cjeanner at redhat.com
Tue Jul 24 04:44:57 UTC 2018

On 07/23/2018 08:33 PM, Emilien Macchi wrote:
> Thanks Monty for pointing that out to me today on #ansible-devel.
> Context: https://github.com/ansible/ansible/pull/41811
> The top-level fact vars are currently being deprecated in Ansible, maybe
> 2.7.
> It looks like it only affects tripleo-validations (in a quick look), but
> it could be more.
> See: http://codesearch.openstack.org/?q=ansible_facts&i=nope&files=&repos=
> An example playbook was written to explain what is deprecated:
> https://github.com/ansible/ansible/pull/41811#issuecomment-399220997
> But it seems like, starting with Ansible 2.5 (what we already have in
> Rocky and beyond), we should encourage the usage of ansible_facts
> dictionary.
> Example:
> var=hostvars[inventory_hostname].ansible_facts.hostname
> instead of:
> var=ansible_hostname

guh.... I'm sorry, but this is a non-sense, ugly as hell, and will just
make things overcomplicated as sh*t. Like, really. I know we can't
really have a word about that kind of decision, but... damn, WHY ?!

Thanks for the heads-up though - will patch my current disk space
validation update in order to take that into account.

> Can we have someone from TripleO Validations to help, and make sure we
> make it working for future versions of Ansible.
> Also there is a way to test this behavior by disabling the
> 'inject_facts_as_vars' option in ansible.cfg.
> Hope this helps,
> -- 
> Emilien Macchi
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Cédric Jeanneret
Software Engineer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180724/c020c571/attachment.sig>

More information about the OpenStack-dev mailing list