{"id":50554926,"url":"https://github.com/octavian451/ansible_poc","last_synced_at":"2026-06-04T06:02:31.367Z","repository":{"id":310660215,"uuid":"1040048039","full_name":"octavian451/ansible_poc","owner":"octavian451","description":"A PoC project demonstrating Ansible with Docker Compose","archived":false,"fork":false,"pushed_at":"2025-09-19T08:45:30.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T14:54:20.723Z","etag":null,"topics":["ansible","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octavian451.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-18T11:30:52.000Z","updated_at":"2026-02-25T18:37:15.000Z","dependencies_parsed_at":"2025-08-19T14:30:47.292Z","dependency_job_id":"48e285eb-e587-4c2b-b192-56c86e7974ab","html_url":"https://github.com/octavian451/ansible_poc","commit_stats":null,"previous_names":["deck451/ansible_poc","octavian-devsec/ansible_poc","octavian451/ansible_poc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/octavian451/ansible_poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octavian451%2Fansible_poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octavian451%2Fansible_poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octavian451%2Fansible_poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octavian451%2Fansible_poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octavian451","download_url":"https://codeload.github.com/octavian451/ansible_poc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octavian451%2Fansible_poc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33891733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","docker-compose"],"created_at":"2026-06-04T06:02:26.373Z","updated_at":"2026-06-04T06:02:31.362Z","avatar_url":"https://github.com/octavian451.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible_poc\n\nA proof-of-concept project demonstrating running an ansible playbook on 3 backend servers,\nrunning under a Docker container using Docker Compose.\n\n## Quick Start\n\n### clone the repository and cd into it\n```sh\ngit clone https://github.com/deck451/ansible_poc.git\ncd ./ansible_poc\n```\n\n### generate ssh keys (and set permissions for them) for the control node and servers\nThe public key will be mounted on the servers as `authorized_keys` file.\nIt could also have `644` permissions instead of `600`, but `600` is safest.\nThe general idea is that it should not be group-writable, nor world-writable.\n\n```sh\nssh-keygen -t ed25519 -f ./control_node/ansible_key -N \"\"\nsudo chmod 600 ./control_node/ansible_key.pub\nsudo chmod 600 ./control_node/ansible_key\n```\n\n### set up account and vault passwords\nGenerate .env file in your local directory (should be `./ansible_poc`)\n```sh\ntouch ./.env\n```\nthen set the user account password for all of the servers by adding a line similar to\n```sh\nSSH_USER_PASSWORD=your_password_of_choice\n```\nnext, add another line for the ansible vault passwored:\n```sh\nANSIBLE_VAULT_PASSWORD=your_vault_password_of_choice\n```\n\n### start the containers\n```sh\ndocker compose up --build\n```\n\n### docker exec into the control node, as the `ansible` user\n```sh\ndocker exec -it --user ansible -w /home/ansible control_node /bin/bash\n```\n\n### manually `ssh` into any of the servers from the control node\nCan also `ssh` into `control_node` from the control node itself\n```sh\nssh ansible@server_0\nssh ansible@server_1\nssh ansible@server_2\nssh ansible@server_3\nssh ansible@control_node\n```\n\n### test reading back all of the hosts defined in the inventory file\n```sh\nansible all --list-hosts\n```\n\n### test ansible `ssh` connection\nThe `ssh` key should be the default one, so no need to specify it in the command below.\nSame goes for the inventory file.\n```sh\nansible all -m ping\n```\n\n### test ansible facts gathering\nIgnoring the `--limit` flag has `ansible` pull facts from all of the hosts\n```sh\nansible all -m gather_facts --limit server_1\n```\n\n### test ansible elevated privileges\n```sh\nansible all -m apt --become --ask-become-pass\n```\nMake sure you input the password you set in your `.env` file ([see here](#set-up-account-and-vault-passwords))\n\n### install a package on all servers (vim)\n```sh\nansible all -m apt -a name=vim --become --ask-become-pass\n```\n\n### try non-interactive commands\n```sh\nansible all -m apt --become --extra-vars \"@~/vault.yml\" --vault-password-file ~/.vault_pass\n```\n\n### run a playbook, interactively (will ask for become password)\n```sh\nansible-playbook --vault-password-file ~/.vault_pass --ask-become-pass ./playbooks/your_playbook.yml\n```\n\n### run a playbook without asking for the password\n```sh\nansible-playbook --vault-password-file ~/.vault_pass ./playbooks/your_playbook.yml\n```\n\n### check available tags in a playbook\n```sh\nansible-playbook --vault-password-file ~/.vault_pass --list-tags ./playbooks/your_playbook.yml\n```\n\n### run playbook only for certain tag(s)\n```sh\nansible-playbook --vault-password-file ~/.vault_pass --tags tag1,tag2,tag3 ./playbooks/your_playbook.yml\n``` \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctavian451%2Fansible_poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctavian451%2Fansible_poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctavian451%2Fansible_poc/lists"}