9.4. 卸载容器化 Ansible Automation Platform
卸载 Ansible Automation Platform 的基于容器的安装。
先决条件
- 您已以专用非 root 用户身份登录 Red Hat Enterprise Linux 主机。
流程
如果要重新安装 Ansible Automation Platform 并希望使用保留的数据库,您必须收集现有的 secret 密钥:
首先,列出可用的 secret:
$ podman secret list接下来,运行以下命令来收集 secret 密钥:
$ podman secret inspect --showsecret <secret_key_variable> | jq -r .[].SecretData例如:
$ podman secret inspect --showsecret controller_secret_key | jq -r .[].SecretData
运行
卸载playbook:$ ansible-playbook -i inventory ansible.containerized_installer.uninstall这会停止所有 systemd 单元和容器,然后删除容器化安装程序使用的所有资源,例如:
- 配置和数据目录和文件
- systemd 单元文件
- podman 容器和镜像
- RPM 软件包
要保留容器镜像,请将
container_keep_images参数设置为true。$ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e container_keep_images=true要保留 PostgreSQL 数据库,请将
postgresql_keep_databases参数设置为true。$ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e postgresql_keep_databases=true