使用社区 EE 镜像运行 Ansible
您可以运行 ansible,而无需使用社区图像构建自定义 EE。
1.拉取社区版EE镜像
podman pull ghcr.io/ansible-community/community-ee-base:latest
2.在容器内针对本地主机运行以下 Ansible 临时命令community-ee-minimal
:
ansible-navigator exec "ansible localhost -m setup" --execution-environment-image ghcr.io/ansible-community/community-ee-minimal:latest --mode stdout
3.在本地,创建一个简单的测试剧本并在容器内运行它:
- name: Gather and print local factshosts: localhostbecome: truegather_facts: truetasks:- name: Print factsansible.builtin.debug:var: ansible_facts