启动podman服务

root@localhost:~# loginctl enable-linger user1
user1@localhost:~/ansible$ systemctl --user daemon-reload
user1@localhost:~/ansible$ systemctl --user enable --now podman
user1@localhost:~/ansible$ systemctl --user start podman
user1@localhost:~/ansible$ systemctl --user status podman

安装podman-compose

user1@localhost:~/ansible$ sudo dnf install -y python3-pip
user1@localhost:~/ansible$ pip3 install podman-compose --user
user1@localhost:~/ansible$ which podman-compose

~/.local/bin/podman-compose

user1@localhost:~/ansible$ echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
user1@localhost:~/ansible$ source ~/.bashrc

宿主机安装ansible-navigator sudo dnf install -y python3-pip sudo python3 -m pip install ansible-navigator // 还有一种普通用户安装的方式 命令启动vscode code –user-data-dir ~/.vscode-data 或者直接使用code命令 下载的镜像

图片

ansible-navigator.yml文件

图片

.devcontainer/devcontainer.json文件

图片

.vscode/settings.json文件

图片

获取devcontainer镜像ID替代标签

podman images --no-trunc | grep ansible-dev-tools-rhel8

图片

使用sha256…替换devcontainer.json文件中的镜像位置

图片

开发容器中的案例如下

图片

图片

图片