gableroux/asdjfbkjahsvfjahvsdfjahsdfjkhasvdf

By gableroux

Updated almost 6 years ago

Image

47

ansible docker image

Docker image to use ansible and ssh in a CI :+1:

Docker StarsDocker PullsDocker AutomatedDocker BuildImageVersionLayersRequirements Status

Usage

Command line
docker run --rm -it gableroux/ansible:2.7.10 ansible --help
gitlab-ci example
.ansible: &ansible
  stage: deploy
  when: manual
  image: gableroux/ansible:2.7.10
  before_script:
    # https://docs.gitlab.com/ee/ci/ssh_keys/
    - eval $(ssh-agent -s)
    - mkdir ~/.ssh/
    - chmod 700 ~/.ssh
    - echo "$SSH_CONFIG" > ~/.ssh/config
    - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null

deploy-example-master:
  <<: *ansible
  script:
    - ansible --version
    - ansible-playbook -i host-example deploy.yml
  only:
    - master

FAQ

How to deploy new docker image

There is a script in scripts that reads values from versions.txt and runs required commands to push to the repository with tags and trigger docker hub. :v:

Why bother using a docker image

Installing with pip is fine, but pulling this image is faster.

Why not use an official ansible image?

As described here in the short description:

Images for automated testing of Ansible. They do not include Ansible and are not for end users.

The official image is used to run tests for the ansible project. I wish they had and official image for actually running ansible.

My version is not there, what can I do?

Fork the project, replace ENV and push your own image.

Can I contribute?

Yes, why not?

There are already a lot of ansible docker images out there, why a new one?

I don't trust people when it comes to running critical code against infrastructure. If you wish to use this, I recommend you to fork it and build your own. There are many good alternatives, notably William-Yeh/docker-ansible, but I found it was kind of big or doing too many things. Installing ansible is quite easy so I made a single image based on alpine so it's small. :)

How is this image deployed to docker hub?

I'm using docker's automated build

License

MIT © Gabriel Le Breton

Docker Pull Command

docker pull gableroux/asdjfbkjahsvfjahvsdfjahsdfjkhasvdf