-
-
Notifications
You must be signed in to change notification settings - Fork 4
create initial structure for ansible-dev and set up the container for Ansible server #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tead of indiviual files to the image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!
ansible/Dockerfile
Outdated
RUN mkdir /etc/ansible/ | ||
|
||
# Copy local Ansible configuration file to the image | ||
COPY config/ansible.cfg /etc/ansible/ansible.cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy content of directory rather than individual files
- COPY config/ansible.cfg /etc/ansible/ansible.cfg
+ COPY ../config/ /etc/ansible/
ansible/Dockerfile
Outdated
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a virtual env | ||
RUN python3 -m virtualenv /ansible-venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use venv and provide complete path for ansible-venv
- RUN python3 -m virtualenv /ansible-venv
+ RUN python3 -m venv /opt/ansible-venv --system-site-packages && \
+ /opt/ansible-venv/bin/pip install --no-cache-dir ansible
docker-compose.yml
Outdated
dockerfile: ansible/Dockerfile | ||
volumes: | ||
- ./config/ansible.cfg:/etc/ansible/ansible.cfg | ||
- ./config/hosts:/etc/ansible/hosts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
container should be running so add thec command
+ command: sh -c 'trap "exit" TERM; while true; do sleep 1; done'
config/ansible.cfg
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a basic setup file which we need to change/update later, especially remote_user
+ [defaults]
+ inventory = /etc/ansible/hosts
+ remote_user = root
+ host_key_checking = False
+ retry_files_enabled = False
Fixes
N/A
Description
Set up the foundational architecture for Ansible-dev, beginning with the creation of a container for the Ansible server.
Technical details
In the Dockerfile for the Ansible server, we start with the Debian 12 Slim OS and install necessary packages referenced from the Docker Hub Ansible image. We also install Ansible and generate SSH keys for future connections with managed nodes.
Tests
N/A
Screenshots
N/A
Checklist
Update index.md
).main
ormaster
).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin