1.10. 比较部署之间的配置文件
要帮助您管理 director Operator 和 Red Hat OpenStack Platform (RHOSP)服务的配置,您可以使用 os-diff 工具比较 director Operator 部署与 Red Hat OpenStack Services on OpenShift (RHOSO)云之间的配置文件。
注意
OS-diff 目前不支持 director Operator。
先决条件
在您的环境中安装和配置 golang:
dnf install -y golang-github-openstack-k8s-operators-os-diff
流程
根据您的环境配置
/etc/os-diff/os-diff.cfg文件和/etc/os-diff/ssh.config文件。要允许 os-diff 连接到云并从config.yaml文件中描述的服务拉取文件,您必须在os-diff.cfg文件中设置以下选项:[Default] local_config_dir=/tmp/ service_config_file=config.yaml [Tripleo] ssh_cmd=ssh -F ssh.config1 director_host=standalone2 container_engine=podman connection=ssh remote_config_path=/tmp/tripleo local_config_path=/tmp/ [Openshift] ocp_local_config_path=/tmp/ocp connection=local ssh_cmd=""如果您使用主机文件连接到云,请将
ssh.config文件配置为允许 os-diff 访问 RHOSP 环境,例如:Host * IdentitiesOnly yes Host virthost Hostname virthost IdentityFile ~/.ssh/id_rsa User root StrictHostKeyChecking no UserKnownHostsFile=/dev/null Host standalone Hostname standalone IdentityFile <path to SSH key> User root StrictHostKeyChecking no UserKnownHostsFile=/dev/null Host crc Hostname crc IdentityFile ~/.ssh/id_rsa User stack StrictHostKeyChecking no UserKnownHostsFile=/dev/null-
将
<path to SSH key> 替换为 SSH 密钥的路径。您必须为IdentityFile提供值,才能获得对 RHOSP 环境的完整工作访问权限。
-
将
如果使用清单文件连接到云,请从 Ansible 清单生成
ssh.config文件,例如tripleo-ansible-inventory.yaml文件:$ os-diff configure -i tripleo-ansible-inventory.yaml -o ssh.config --yaml
验证
测试您的连接:
$ ssh -F ssh.config standalone