Skip to content

sofmeright/ansible-oci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Release Latest Release Status ko-fi

Ansible Ansible OCI

A lightweight, production-ready Ansible Docker Image built on python:3.13.5-alpine3.22 (plans to update as needed). This image was designed for running playbooks in CI/CD pipelines or local automation tasks.

Powered by Ansible 2.18.6, pre-loaded with common community collections and winrm support for managing Windows nodes.


See Also:


🚀 Image Features

  • ✅ Based on Python 3.13.5 + Alpine 3.22 for minimal footprint
  • 🛠️ Includes:
    • ansible-core==2.18.6
    • ansible-lint==25.6.1
    • coreutils
    • curl
    • git
    • jq
    • openssh
    • openssh-keygen
    • pywinrm for Windows management
    • rage
    • rsync
    • sops
    • yq
  • 📦 Pre-installed Ansible collections:
    • ansible.posix
    • ansible.windows
    • community.docker
    • community.sops
  • 🔐 Host key checking is disabled via ANSIBLE_HOST_KEY_CHECKING=false for smoother CI/CD use

⛓️‍💥 Links:

  • Dockerhub:
    • Public Image Releases.
  • GitLab:
    • Official Source, up to date; but 100% uptime can not be guaranteed.
  • Github:
    • Source is available, (This can get out of sync with Gitlab).

⚙️ Usage

▶️ Run Locally

Basic Example:

docker run --rm -v $(pwd):/app -w /app prplanit/ansible-oci:latest ansible-playbook playbook.yaml

Advanced Example:

docker run -v ./playbook.yaml:/root/playbook.yaml -v /srv/gitops/ad-arbitorium-private:/srv/gitops/ad-arbitorium-private -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --rm prplanit/ansible-oci:latest ansible-playbook --private-key /root/.ssh/id_rsa -i /srv/gitops/ad-arbitorium-private/ansible/inventory /root/playbook.yaml -e ansible_windows_password=$WINDOWS_ANSIBLE_PASSWORD

📦 Use in GitLab CI/CD

ansible-deploy:
  stage: deploy
  image: prplanit/ansible-oci:latest
  script:
    - ansible-playbook ansible/deploy.yaml -i ansible/inventory

📁 File Structure

This image expects your playbooks and configuration files to live inside the /app directory by default.

Example layout:

/app
├── ansible.cfg
├── inventory
├── playbook.yaml
└── roles/

📝 Environment Variables

Variable Purpose
ANSIBLE_HOST_KEY_CHECKING Disables host key checking (default: false)

⚠️ Notes

  • Keep in mind that pywinrm is included, but for full Windows management, you may need to pass additional credentials or certificates depending on your environment.
  • This image does not contain systemd or sshd—it's designed strictly as a control node for executing playbooks, not as a managed host.

🐚 CMD Behavior

By default, the image runs:

ansible-playbook --version

Override this by providing your own entrypoint or script.


🫱🏽‍🫲🏽 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.


🪪 License

Use it freely, deploy wisely, and remember: automation is power, but also responsibility.


⚠️ Disclaimer

This image is provided as-is, without warranties, implied Ansible enlightenment, or protection from weekend-dev-ops rabbit holes. The author assumes no responsibility if your playbook summons demons or accidentally configures your microwave.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published