Bug 28787 - ansible_distribution variables are missing in mageia 8 interrogated from Mageia 7 (but not other combinations)
Summary: ansible_distribution variables are missing in mageia 8 interrogated from Mage...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 10:16 CEST by eric gerbier
Modified: 2021-05-05 09:24 CEST (History)
1 user (show)

See Also:
Source RPM: ansible-2.9.18-1.mga8.src.rpm
CVE:
Status comment: Unsure whether the problem is M7 or M8


Attachments

Description eric gerbier 2021-04-16 10:16:48 CEST
Description of problem:
In mageia 8 ansible facts are not complete : ansible_distribution variables are missing. 
On Mageia 7, and other distributions, if I ask the facts with "ansible host_mga7 -m setup -a 'filter=ansible_distribution*' , I receive fields like :
        "ansible_distribution": "Mageia",
        "ansible_distribution_file_parsed": true,
        "ansible_distribution_file_path": "/etc/redhat-release",
        "ansible_distribution_file_variety": "RedHat",
        "ansible_distribution_major_version": "7",
        "ansible_distribution_release": "Official",
        "ansible_distribution_version": "7",

this fact variable are used in ansible doc, for example in https://docs.ansible.com/ansible/latest/collections/ansible/builtin/constructed_inventory.html  and https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html

but, if I ask on localhost with "ansible localhost -m setup -a 'filter=ansible_distribution*'", it works !

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. ansible host_mga8 -m setup -a 'filter=ansible_distribution*'
2. ansible host_mga7 -m setup -a 'filter=ansible_distribution*'
3.
Comment 1 Lewis Smith 2021-04-16 20:57:39 CEST
Thank you for the report.
It is not clear in what circumstances this works or does not. My interpretation (guess) is that if you use it for a remote host, the ansible_distribution data is missing; but is present if you run it for the local machine.
Where do the 'host_mga*' IDs come from? Excuse me asking; ansible is not something I use & can try.

Please confirm or correct this judgement.

Status: NEW => NEEDINFO
Source RPM: (none) => ansible-2.9.18-1.mga8.src.rpm
CC: (none) => lewyssmith

Aurelien Oudelet 2021-04-22 21:29:13 CEST

CC: (none) => ouaurelien

Comment 2 eric gerbier 2021-04-27 12:09:42 CEST
I had some more tests : the problem only occurs when the ansible command
- is launched on mageia 7
- ask a facts on mageia 8 computer

all others ways are ok :
mageia 7 => mageia 7 is ok
mageia 8 => mageia 8 is ok
mageia 8 => mageia 7 is ok
mageia 7 => centos 7 is ok

for the tests, put ip adresses in a "myhosts" file, then from a mageia7 computer (ssh config should be ok) :

ansible ip_mga8 -i myhosts -m setup -a 'filter=ansible_distribution*'

It is not clear for me if the problem is on mageia 7 or 8 ?
if it is a python2 / python 3 problem ?
or an ansible problem ?
Comment 3 Lewis Smith 2021-04-27 20:44:30 CEST
Thank you for these precisions.

Ansible is commited by different people, so assigning this bug globally.

Assignee: bugsquad => pkg-bugs
Summary: ansible_distribution variables are missing in mageia 8 => ansible_distribution variables are missing in mageia 8 interrogated from Mageia 7 (but not other combinations)
Status: NEEDINFO => NEW
Status comment: (none) => Unsure whether the problem is M7 or M8
CC: lewyssmith => (none)

Comment 4 eric gerbier 2021-05-05 09:24:26 CEST
I had today a new test : I have build a backport of ansible from mageia 8 on mageia 7.
so I have upgraded on mageia 7 from ansible-2.7.18-1 to ansible-2.9.18-1

and now the output is ok : 
 ansible lxtest3  -m setup -a 'filter=ansible_distribution*'
[WARNING]: Platform linux on host lxtest3 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
lxtest3 | SUCCESS => {
    "ansible_facts": {
        "ansible_distribution": "Mageia",
        "ansible_distribution_file_parsed": true,
        "ansible_distribution_file_path": "/etc/redhat-release",
        "ansible_distribution_file_variety": "RedHat",
        "ansible_distribution_major_version": "8",
        "ansible_distribution_release": "mga8",
        "ansible_distribution_version": "8",
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false
}

so my guess is this is a problem on M7

Note You need to log in before you can comment on or make changes to this bug.