phpstudy2016快速搭建网站,采购系统,哈尔滨城乡建设局网站首页,软件开发项目预算创建一个名为/ansible/yum.sh 的 shell 脚本#xff0c;该脚本将使用 Ansible 临时命令在各个受管节点上安装 yum 存储库.
存储库1#xff1a; 存储库的名称为 EX294_BASE 描述为 EX294 base software 基础 URL 为 http://content/rhel8.0/x86_64/dvd/BaseOS GPG 签名检查为…创建一个名为/ansible/yum.sh 的 shell 脚本该脚本将使用 Ansible 临时命令在各个受管节点上安装 yum 存储库.
存储库1 存储库的名称为 EX294_BASE 描述为 EX294 base software 基础 URL 为 http://content/rhel8.0/x86_64/dvd/BaseOS GPG 签名检查为启用状态 GPG 密钥 URL 为 http://content/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release 存储库为启用状态
存储库2 存储库的名称为 EX294_STREAM 描述为 EX294 stream software 基础 URL 为 http://content/rhel8.0/x86_64/dvd/AppStream GPG 签名检查为启用状态 GPG 密钥 URL 为 http://content/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release 存储库为启用状态
#创建文件yum.sh(注意在ansible目录下)vim yum.sh#根据要求内容如下注意其中不能乱有空格出现#!/bin/bashansible all -m yum_repository -a nameEX294_BASE descriptionEX294 base software \baseurlhttp://content/rhel8.0/x86_64/dvd/BaseOS \gpgcheckyes \gpgkeyhttp://content/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release \enabledyesansible all -m yum_repository -a nameEX294_STREAM descriptionEX294 stream software \baseurlhttp://content/rhel8.0/x86_64/dvd/AppStream \gpgcheckyes \gpgkeyhttp://content/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release \enabledyes#给予运行权限chmod x yum.sh#运行脚本bash yum.sh 出现类似主机完成即可
#临时命令查看ansible all -m shell -a yum repolist