-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e744c0
commit 8709582
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# image: https://github.com/orgs/ansible-community/packages/container/package/community-ee-base | ||
# image and version from: https://github.com/orgs/ansible-community/packages/container/package/community-ee-base | ||
# docs1: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-to-containers | ||
# docs2: https://learn.microsoft.com/en-us/azure/developer/ansible/configure-in-docker-container | ||
|
||
FROM ghcr.io/ansible-community/community-ee-base:latest | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL version="latest" | ||
|
||
# You should change the below if official image latest version changed | ||
LABEL version="2.16.1" | ||
LABEL description="Ansible" | ||
|
||
USER root | ||
|
@@ -21,7 +23,6 @@ COPY ./test/playbook.yml ./test/ | |
|
||
# Install tools | ||
RUN yum check-update; \ | ||
yum install -y gcc libffi-devel; \ | ||
yum install -y wget; \ | ||
yum install -y openssl; \ | ||
yum install -y vim; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Ansible | ||
|
||
This image based on Ansible official image, Test case at test directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Test Ansible | ||
|
||
1. 运行 Ansible 容器 | ||
``` | ||
docker run -it -d --name ansible websoft9dev/ansible | ||
``` | ||
2. 进入容器 | ||
``` | ||
docker exec -it ansible bash | ||
``` | ||
3. 使用 vim 编辑 test 目录下的 inventory 文件,修改成您的目标主机 | ||
``` | ||
vim test/inventory | ||
``` | ||
4. 运行 Ansible playbook | ||
``` | ||
cd test | ||
ansible-playbook -i inventory playbook.yml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
{ | ||
"dist": "community", | ||
"version": [ | ||
"latest" | ||
"2.16.1" | ||
] | ||
} | ||
], | ||
|