配置虚拟私有云
云平台架管理
跳板机配置
ansible 管理主机
dnf install -y ansible-core glibc-langpack-zh
ssh-keygen
chmod 0400 /root/.ssh/id_rsa
ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.1.125
ansible --version
代理 Yum 仓库
dnf install -y nginx
vim /etc/nginx/default.d/dnf_proxy.conf
resolver 100.125.1.250 100.125.129.250 valid=5 ipv6=off;
location ~ ^/rockylinux/(.*)$ {
proxy_pass https://repo.huaweicloud.com/rockylinux/$1;
}
systemctl enable --now nginx
私有 Yum 仓库
dnf install -y createrepo
mkdir -p /var/localrepo
createrepo --update /var/localrepo
ln -s /var/localrepo /usr/share/nginx/html/
配置 Yum 客户端