AIX O/S version detection problems in Ansible 2.8

Hi,

Noticed that a few of our playbooks failed to run on AIX after trying to move from 2.7.10 to 2.8.4
I´ve tracked it down to handling of the ansible_distribution_major_version fact.

We include variables in the playbooks like this:

  • name: Include OP5 varibles.
    include_vars: “{{ item }}”
    with_first_found:
  • “{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml”
  • “other_os.yml”

This fails in 2.8 since the file supposed to be included is named AIX5.yml , but in 2.8 the variable is set to “5.3”

If I check the fact cache file it looks like this on both 2.7.10 and 2.8.4, which seems correct:

“ansible_distribution”: “AIX”,
“ansible_distribution_major_version”: “5”,
“ansible_distribution_release”: “3”,
“ansible_distribution_version”: “5.3”,

However, if I debug the variables in the playbook, major version is wrong when running 2.8.4, which makes the import of our variable file fail:

TASK [op5 : debug] ***********************************************************************************************************************************************
ok: [xxxx.xxxx.xxxx] => {
“ansible_distribution”: “AIX”
}

TASK [op5 : debug] ***********************************************************************************************************************************************
ok: [xxxx.xxxx.xxxx] => {
“ansible_distribution_major_version”: “5.3”

Could this be a bug ? It doesn´t seem correct that the facts differ from the debug.

This look like a bug, but when I check the code distribution_major_version for AIX is not changed between 2.7.10 and 2.8.4, only distribution_version and distribution_release has some changes.

The fact is parsing the output of /usr/bin/oslevel what output do you get from that command?

bash-3.00# /usr/bin/oslevel
5.3.0.0