raksoq / Ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible

A simple Docker image for Ansible

Prerequesits:

  • Git
  • Docker

Initial setup:

  1. Clone this repository:
git clone https://github.com/Dgotlieb/Ansible.git
  1. In mnt/keys folder - replace the priavte key with your server key (e.g. EC2)

  2. In mnt/hosts file - Change the IP address to the IP address of the machine/s you want to control.

  3. Start container mounting files:
    Mac / Linux users

docker run -it -v $(pwd)/mnt:/opt/ansible dgotlieb/ansible-controller:1.0.0 /bin/bash

Windows users (CMD)

docker run -it -v %cd%/mnt:/opt/ansible dgotlieb/ansible-controller:1.0.0 /bin/bash
  1. Restrict key permissions:
chmod 400 keys/private.pem
  1. Validate you can ping your hosts using Ansible:
ansible all -m ping

Local build (optional)

if you wish to build the Docker image locally, you can run the below commands:

  1. Build the Docker image:
docker build -t ansible-controller .
  1. Run the container using:
    Mac / Linux users
docker run -it -v $(pwd)/mnt:/opt/ansible ansible-controller /bin/bash

Windows users (CMD)

docker run -it -v %cd%/mnt:/opt/ansible ansible-controller /bin/bash

About


Languages

Language:Dockerfile 78.1%Language:Shell 21.9%