# AIX O/S version detection problems in Ansible 2.8

**URL:** <https://forum.ansible.com/t/aix-o-s-version-detection-problems-in-ansible-2-8/31392>\
**Category:** Ansible Project\
**Created:** [September 30, 2019, 11:35am UTC](https://forum.ansible.com/t/aix-o-s-version-detection-problems-in-ansible-2-8/31392 "2019-09-30T11:35:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Delin](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Daniel\_Delin](https://forum.ansible.com/u/Daniel_Delin)\
**Post date:** [September 30, 2019, 11:35am UTC](https://forum.ansible.com/t/aix-o-s-version-detection-problems-in-ansible-2-8/31392/1 "2019-09-30T11:35:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 30, 2019, 5:05pm UTC](https://forum.ansible.com/t/aix-o-s-version-detection-problems-in-ansible-2-8/31392/2 "2019-09-30T17:05:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Daniel\_Delin](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Daniel\_Delin](https://forum.ansible.com/u/Daniel_Delin)\
**Post date:** [October 1, 2019, 7:17am UTC](https://forum.ansible.com/t/aix-o-s-version-detection-problems-in-ansible-2-8/31392/3 "2019-10-01T07:17:20Z")

</div>

bash-3.00# /usr/bin/oslevel  
5.3.0.0
