Ansible yum模块未看到选项为installroot的存储库
我想将基本CentOS安装到指定目录,例如/var/CentOS。目录为空。我在yum中使用下一个命令:Ansible yum模块未看到选项为installroot的存储库,ansible,yum,Ansible,Yum,我想将基本CentOS安装到指定目录,例如/var/CentOS。目录为空。我在yum中使用下一个命令: yum --disablerepo='*' --enablerepo='base,updates' --releasever=7 --installroot=/var/centos groupinstall @core 此命令安装基本系统时不会出现任何问题。我想通过Ansible做同样的事情 在Ansible I用法中,下一个任务: - name: Install base Cen
yum --disablerepo='*' --enablerepo='base,updates' --releasever=7 --installroot=/var/centos groupinstall @core
此命令安装基本系统时不会出现任何问题。我想通过Ansible做同样的事情
在Ansible I用法中,下一个任务:
- name: Install base CentOS
yum:
state: latest
name: "@core"
installroot: "/var/centos/"
disablerepo: "*"
enablerepo: "base,updates"
releasever: "7"
执行剧本时,我收到一个错误:
Cannot find a valid baseurl for repo: base/$releasever/x86_64
据我所知,百胜银行没有看到任何回购协议
我列出以下清单:
- name: Install base CentOS
yum:
list: repos
installroot: "/var/centos/"
当我执行任务时,我什么也没有收到
为什么yum模块看不到repos
已更新。
在执行Install base任务之前,我执行了命令-rpm--root/var/centos--force--nodeps-ivhhttp://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-6.1810.2.el7.centos.x86_64.rpm
,之后一切正常
最终剧本:
vars:
root_path: "/var/centos/"
tasks:
- name: Install package centos-release-7-6.1810.2.el7.centos.x86_64.rpm
shell: rpm --root {{ root_path }} --force --nodeps -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-6.1810.2.el7.centos.x86_64.rpm
- name: Install base CentOS
yum:
state: installed
name:
- "@core"
installroot: "{{ root_path }}"
disablerepo: "*"
enablerepo: "base,updates"
releasever: "7"
我在尝试自动化脱机yum存储库时也遇到了同样的问题。到目前为止,我只是在使用命令,看不到任何其他方法。我在尝试自动化脱机yum存储库时遇到了相同的问题。到目前为止,我只是在使用命令,没有其他办法。