ansible-playbook -i inventory/mycluster/hosts.yaml -b cluster.yml -vvvv报错

来源:4-3 用kubespray一键部署生产级k8s集群

慕容7192790

2021-04-30

ansible-playbook -i inventory/mycluster/hosts.yaml -b cluster.yml -vvvv
二进制文件也下载了,报这个错误

TASK [kubernetes/preinstall : Install packages requirements] ***********************************************************************************************************
task path: /root/kubespray-2.15.0/roles/kubernetes/preinstall/tasks/0070-system-packages.yml:58
fatal: [srv4]: FAILED! => {
“attempts”: 4,
“changed”: false,
“invocation”: {
“module_args”: {
“allow_downgrade”: false,
“autoremove”: false,
“bugfix”: false,
“conf_file”: null,
“disable_excludes”: null,
“disable_gpg_check”: false,
“disable_plugin”: [],
“disablerepo”: [],
“download_dir”: null,
“download_only”: false,
“enable_plugin”: [],
“enablerepo”: [],
“exclude”: [],
“install_repoquery”: true,
“install_weak_deps”: true,
“installroot”: “/”,
“list”: null,
“lock_timeout”: 30,
“name”: [
“libselinux-python”,
“device-mapper-libs”,
“nss”,
“conntrack”,
“openssl”,
“curl”,
“rsync”,
“socat”,
“unzip”,
“e2fsprogs”,
“xfsprogs”,
“ebtables”,
“ipvsadm”,
“ipset”
],
“releasever”: null,
“security”: false,
“skip_broken”: false,
“state”: “latest”,
“update_cache”: false,
“update_only”: false,
“use_backend”: “auto”,
“validate_certs”: true
}
},
“msg”: “\n\n One of the configured repositories failed (Unknown),\n and yum doesn’t have enough cached data to continue. At this point the only\n safe thing yum can do is fail. There are a few ways to work “fix” this:\n\n 1. Contact the upstream for the repository and get them to fix the problem.\n\n 2. Reconfigure the baseurl/etc. for the repository, to point to a working\n upstream. This is most often useful if you are using a newer\n distribution release than is supported by the repository (and the\n packages for the previous distribution release still work).\n\n 3. Run the command with the repository temporarily disabled\n yum --disablerepo= …\n\n 4. Disable the repository permanently, so yum won’t use it by default. Yum\n will then just ignore the repository until you permanently enable it\n again or use --enablerepo for temporary usage:\n\n yum-config-manager --disable \n or\n subscription-manager repos --disable=\n\n 5. Configure the failing repository to be skipped, if it is unavailable.\n Note that yum will try to contact the repo. when it runs most commands,\n so will have to try and fail each time (and thus. yum will be be much\n slower). If it is a very temporary problem though, this is often a nice\n compromise:\n\n yum-config-manager --save --setopt=.skip_if_unavailable=true\n\nCannot find a valid baseurl for repo: base/7/x86_64\n”,
“rc”: 1,
“results”: []
}
PLAY RECAP *************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
srv3 : ok=75 changed=1 unreachable=0 failed=1 skipped=81 rescued=0 ignored=0
srv4 : ok=60 changed=1 unreachable=0 failed=1 skipped=69 rescued=0 ignored=0
srv5 : ok=58 changed=1 unreachable=0 failed=1 skipped=71 rescued=0 ignored=0

写回答

1回答

慕UI1542582

2021-05-01

看一下你的yum源是否正常,如果不正常,找找别的yum源

0
1
慕容7192790
非常感谢!
2021-05-05
共1条回复

Kubernetes生产落地全程实践

一个互联网公司落地Kubernetes全过程点点滴滴

2293 学习 · 2216 问题

查看课程