Giter Club home page Giter Club logo

ansible_container's Introduction

ansible_container

Looking to place Ansible in a container (i.e. run Ansible in a container to manage other stuff).

If you want to exclude items from the Docker build place the details of them in a .dockerignore file, then make sure to put the .dockerignore file into a .gitignore file as well.

Docker container - https://ghcr.io/cjcshadowsan/ansible_container

Usage

To use, you can just git clone and build, then run - Or call using something like:

docker run -it --name=ansible --privileged --rm \
  --network=host \
  -v ~/.ssh/id_rsa:/root/.ssh/id_rsa \
  -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \
  -v $(pwd):/ansible/playbooks \
  -v $(pwd)/log:/var/log/ansible \
ghcr.io/cjcshadowsan/ansible_container:master "$@"

Clearly you don't need to run privileged, but you may need to.

Note that if you can SSH to it, then copying your key to the temporary container will allow you to run for the lifetime of the container. This is a security risk, you have been warned - So don't use a key that is for anything other than the specific deployment you're working on.

Running day-to-day - Helper script

There's a helper script here in ansible-helper.sh that you can alias to ansible-playbook and it'll work pretty much just like ansible-playbook, albeit with a slightly slower startup.

TODO:

Add releases with version(s) - But why not just keep with the times and code your stuff to work with latest, if you can pull this container? Hmmm?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.