Sign inSign up

rotecodefraktion/ansible_docker

By rotecodefraktion

•Updated about 1 year ago

ansible image with git, zsh and openssl-client. Based on latest ubuntu

Image
Integration & delivery
Operating systems
0

1.1K

rotecodefraktion/ansible_docker repository overview

⁠Ansible Docker Container

This Docker image is based on the latest minimal Ubuntu version and is prepared for use with Ansible. It includes various tools and configurations to facilitate working with Ansible.

⁠Table of Contents

⁠Usage

To start a container based on this image, use the following command:

docker run -it rotecodefraktion/ansible_docker

to mount an persistent directory (e.g /tmp/ansible_docker ) to the container run and name the container ansible

docker run -v /tmp/docker_ansible:/install/ansible -it -d --name ansible_docker rotecodefraktion/ansible_docker

⁠Configuration

The image came with a predefined empty ssh key-pair. If you want using your own you can build an own image from scratch at github Repository⁠.

You can create a fresh ssh key-pair with ssh-keygen inside the container or you can use your own ssh key from outside the container. To copy your own ssh-key to the container:

docker cp ~/.ssh/id_rsa ansible_docker:/home/ansible/.ssh/
docker exec -u 0 -it ansible_docker chown ansible:ansible /home/ansible/.ssh/id_rsa
docker exec -it ansible_docker /bin/zsh

** Please use a allways a secret when generating private keys

For further onfiguration, modify the corresponding environment variables in the Dockerfile and create a new image.

  • ANSIBLE_USER: ansible or any other user inside the container which connects to the satellites
  • ANSIBLE_USER_UID: 1002 or any other id, helps to read/write attached filesystems to the container
  • ARG ANSIBLE_HOME: /home/ansible
  • ANSIBLE_WORKDIR: attached directory from host to container
  • Copy all ssh keys (private keys) from ./config/ssh_keys to ANSIBLE_HOME/.ssh/ ** Please use a allways a secret when generating private keys

If you build the docker image behind ZScaler or similar you can upload the necessary certificates to ./conifg/cacerts to avoid git certifcates errors The container will start with the zsh shell, and you will be in the working directory for Ansible.

⁠Dockerfile Contents

The Dockerfile installs the following packages and configures the environment:

  • Base Image: Latest version of Ubuntu.
    • gcc
    • python3 python3-pip python3-venv
    • wget curl
    • openssh-client
    • vim
    • zsh
    • ohmyzsh
    • git
    • sudo

⁠Licenses

This project uses the following licenses:

Tag summary

Content type

Image

Digest

sha256:857e87ec1…

Size

464.6 MB

Last updated

about 1 year ago

docker pull rotecodefraktion/ansible_docker