Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with ansible 2.8 (missing ansible facts) #556

Closed
hogarthj opened this issue Mar 4, 2019 · 2 comments
Closed

Compatibility with ansible 2.8 (missing ansible facts) #556

hogarthj opened this issue Mar 4, 2019 · 2 comments

Comments

@hogarthj
Copy link

@hogarthj hogarthj commented Mar 4, 2019

We run automated weekly tests of all our roles against preview and nightly builds of ansible.

Any yum interaction with a combination of mitogen 0.2.5 and the ansible 2.8 nightly results in:

TASK [ansible_role_yum : configure packages] **********************************************************************************************************************************************************************
failed: [initial] (item={u'name': u'yum-utils'}) => {"changed": false, "item": {"name": "yum-utils"}, "msg": ["Could not detect which major revision of yum is in use, which is required to determine module backend.", "You can manually specify use_backend to tell the module whether to use the yum (yum3) or dnf (yum4) backend})"]}
failed: [initial] (item={u'name': u'yum-plugin-priorities'}) => {"changed": false, "item": {"name": "yum-plugin-priorities"}, "msg": ["Could not detect which major revision of yum is in use, which is required to determine module backend.", "You can manually specify use_backend to tell the module whether to use the yum (yum3) or dnf (yum4) backend})"]}

This happens within a docker container and also with a remote host as the target.

I have traced this back to facts not being populated correctly. These are present with ANSIBLE_STRATEGY set to linear but missing when ANSIBLE_STRATEGY is set to mitogen_linear.

        "ansible_distribution": "CentOS", 
        "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": "Core", 
        "ansible_distribution_version": "7", 

This results in, when following the code, eventually the error laid out above since the selection of yum backend is dependent on the distribution being detected correctly.

 ansible-config dump --only-changed
ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = True
DEFAULT_CALLBACK_WHITELIST(env: ANSIBLE_CALLBACK_WHITELIST) = [u'junit']
DEFAULT_HOST_LIST(/srv/ansible/ansible_role_yum/ansible.cfg) = [u'/srv/ansible/ansible_role_yum/tests/inventory']
DEFAULT_ROLES_PATH(/srv/ansible/ansible_role_yum/ansible.cfg) = [u'/srv/ansible/ansible_role_yum/tests/roles']
DEFAULT_STRATEGY(env: ANSIBLE_STRATEGY) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(env: ANSIBLE_STRATEGY_PLUGINS) = [u'/root/.ansible/plugins/strategy', u'/usr/share/ansible/plugins/strategy', u'/srv/ansible/mitogen/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(env: ANSIBLE_TIMEOUT) = 30
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
RETRY_FILES_ENABLED(env: ANSIBLE_RETRY_FILES_ENABLED) = False
ansible --version
ansible 2.8.0.dev0
  config file = /srv/ansible/ansible_role_yum/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

This can be trivially replicated by using a centos container that has ansible 2.8 with mitogen installed:

docker run --rm -it centos bash
yum -y install epel-release
yum-config-manager --add-url=https://releases.ansible.com/ansible/rpm/nightly/devel/epel-7-x86_64/
yum install ansible
# <add mitogen to the system>
ansible -c local -i localhost, -m setup all # this is missing the facts
ANSIBLE_STRATEGY=linear ansible -c local -i localhost, -m setup # this has the distribution facts
@dw
Copy link
Member

@dw dw commented Mar 4, 2019

Thanks for reporting this -- it is likely there is more breakage, I haven't tried against latest devel yet.

They have also landed become plugins, and that requires a good chunk of dev work to catch up with

Loading

@dw
Copy link
Member

@dw dw commented Aug 2, 2019

This is now on the master branch and will make it into the next release. To be updated when a new release is made, subscribe to https://networkgenomics.com/mail/mitogen-announce/

Thanks for reporting this!

Loading

@dw dw closed this Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants