weixin_39892481
weixin_39892481
2020-11-27 10:16

fix for yum to use localinstall when using an rpm

Try to detect if a rpm is local ( or on http ), and use localinstall instead of using install, for RHEL system without subscription.

fixes #11727

该提问来源于开源项目:ansible/ansible-modules-core

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39663593 weixin_39663593 5月前

    I'm a little afraid of the issue you raise in: https://github.com/ansible/ansible/issues/11727#issuecomment-124822160 With current yum, I would expect that to succeed (if there's no subscription error).

    Also, if the rpm specified as a local file needs to have a dependency downloaded, I'm guessing that the user will still get a subscription error?

    So maybe the right answer is to have the user fix the subscription error (by registering the machine? disabling the plugin that's causing it? Changing repositories?)

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 5月前

    This is also a problem for older versions of yum install which do not work the same way with local .rpm packages.

    I don't think the question of if a package has a dependency in a repo should matter. Dependencies can be specified with multiple packages or the rpm may not have any. The problem is older version of yum install will always check for subscription state while yum localinstall only will if package dependencies are needed.

    点赞 评论 复制链接分享
  • weixin_39892481 weixin_39892481 5月前

    When you say "older version", can you be a bit more explicit, and what you mean by "do not work the same way", something like "not checking signature", or something else ?

    点赞 评论 复制链接分享
  • weixin_39892481 weixin_39892481 5月前

    Looking at the code, I do not see a obvious reason why it would fail, since it should just print a warning. I am gonna try with my own laptop, as i suspect the issue is maybe not related to the lack of subscription, but to a side effect of printing the warning or something.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 5月前

    You may be right. It may have just been a failure because of the notice. I'll have to test various versions next week.

    点赞 评论 复制链接分享
  • weixin_39713335 weixin_39713335 5月前

    This module is critical to Ansible's functionality, so it's owned by the Core team, and it can take a while for patches to be reviewed -- and since we're trying to get 2.0 out the door, it's unlikely we'll be able to dig into this until then. Thanks for everyone's patience here.

    点赞 评论 复制链接分享
  • weixin_39912580 weixin_39912580 5月前

    We need this feature as well. ansible 1.9.4 yum 3.4.3 RHEL 7

    点赞 评论 复制链接分享
  • weixin_39663593 weixin_39663593 5月前

    I was asked today what would be needed to move this forward. I've reviewed what's here and in the referenced bug and I think what we're lacking is a reproducible error case. Or lacking that, a clear explanation of what's happening in the error condition.

    It looks like there's a problem with subscription-manager, not with yum. There's some statements that this is only happening with old versions of yum (but -redhat talks about a problem with the yum on rhel7).

    There's also speculation that the problem isn't in what yum does but in our screenscraping of yum output which would mean we just need to adjust our parsing of the output to account for that.

    We need answers to those questions in order to figure out how to fix this.

    点赞 评论 复制链接分享
  • weixin_39608457 weixin_39608457 5月前

    This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

    Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

    点赞 评论 复制链接分享
  • weixin_39608457 weixin_39608457 5月前

    This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

    Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

    点赞 评论 复制链接分享

相关推荐