Ansible 没有包匹配';git2u';发现可用、已安装或已更新

Ansible 没有包匹配';git2u';发现可用、已安装或已更新,ansible,centos7,Ansible,Centos7,我正在尝试在现有节点上运行Ansible,但在所有节点上都出现错误,只有一个节点运行正常: 错误消息: No package matching 'git2u' found available, installed, or updated. 所有节点都是CentOS 7 我做错了什么 从终端使用yum时也是如此: yum info git2u Failed to set locale, defaulting to C Loaded plugins: fastestmirror, langpack

我正在尝试在现有节点上运行Ansible,但在所有节点上都出现错误,只有一个节点运行正常:

错误消息:

No package matching 'git2u' found available, installed, or updated.
所有节点都是CentOS 7

我做错了什么

从终端使用yum时也是如此:

yum info git2u
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks, ps
Loading mirror speeds from cached hostfile
 * epel: d2lzkl7pfhq30w.cloudfront.net
Error: No matching Packages to list
我的剧本:

- name: install epel7 and ius-release to install latest git
  package:
    name:
    - epel-release
    - 'https://repo.ius.io/ius-release-el7.rpm'
    state: present
  when: ansible_distribution == 'CentOS'

- name: install git2u
  package:
    name: git2u
    state: present
  when: ansible_distribution == 'CentOS'
git2u包装是,这是后来的。如果您使用IUS,我强烈建议您在软件包退役时,观察将收到的通知


您的ansible是正确的,软件包或安装软件包的方式可能是错误的。如果您可以列出在centos bash中安装软件包的命令,这将非常有用。也许我能帮上忙。