{"id":16759678,"url":"https://github.com/lnk2past/docker-ansible-demo","last_synced_at":"2026-05-10T00:43:36.715Z","repository":{"id":140087396,"uuid":"426855454","full_name":"Lnk2past/docker-ansible-demo","owner":"Lnk2past","description":"Demo to illustrate basic automation tasks","archived":false,"fork":false,"pushed_at":"2021-11-11T03:55:19.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T20:51:39.608Z","etag":null,"topics":["ansible","ansible-playbook","automation","demo","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lnk2past.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-11-11T03:14:33.000Z","updated_at":"2021-11-12T15:41:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"5522fbe4-849c-459b-bb82-a1f4e3468c19","html_url":"https://github.com/Lnk2past/docker-ansible-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lnk2past%2Fdocker-ansible-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lnk2past%2Fdocker-ansible-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lnk2past%2Fdocker-ansible-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lnk2past%2Fdocker-ansible-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lnk2past","download_url":"https://codeload.github.com/Lnk2past/docker-ansible-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846989,"owners_count":20357296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","ansible-playbook","automation","demo","docker","docker-compose"],"created_at":"2024-10-13T04:08:45.540Z","updated_at":"2026-05-10T00:43:36.648Z","avatar_url":"https://github.com/Lnk2past.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-ansible-demo\n\n[Live] demo to illustrate basic automation tasks. The idea is simple - we want to use `Ansible` to configure a few nodes, run code on them, and then patch that code.\n\n**DISCLAIMER** The setup in this repository does some pretty dumb things and should not be used for more than just education.\n\n## TL/DR\n\n### Build\n\n```shell\ndocker build -t my-alpine .\ndocker build -t my-ansible -f Dockerfile.ansible .\ndocker-compose up\n```\n\n### Run\n\n```shell\ndocker exec -it ansible_docker_demo_ansible_1 sh\n```\n\n```shell\ncd ansible_playbooks\nansible-playbook 01_install_python_setup.yaml\nansible-playbook 02_install_flask.yaml\nansible-playbook 03_deploy_webapp_v1.yaml\nansible-playbook 04_run_webapp.yaml\nansible-playbook 05_deploy_webapp_v2.yaml\n```\n\n## Docker\n\nWe use `Docker` with `Docker Compose` to simulate an environment with a handful of \"fresh nodes\" that a sysadmin will start to work with. There are a number of details assumed and heavily glossed over here, specifically with SSH keys/psswordless SSH being setup automatically. This allows `Ansible` to work nicely right from the beginning.\n\nThere are 3 \"worker\" nodes and 1 \"admin\" node. The admin node is the same image as the workers, but includes `Ansible` as well as some some files pre-installed. Once the compose environment is stood up we can exec into the admin node and begin automating some basic tasks on the worker nodes.\n\n## Ansible\n\nThe playbooks are numbered, and should be executed in that order. They do the following:\n\n1) installs some python requirements for used with `Ansible`\n2) installs `Flask`\n3) deploys v1 of our webapp\n4) starts the webapp\n5) deploys v2 of our webapp\n\nOnce playbook 04 is executed you can navigate to localhost:1333[7/8/9] to see the `Hello World` example taken from `Flask's` quick start. After playbook 05 is executed, refreshing your page will reveal the v2 webapp. The code that is running is a basic `Flask` webapp with the development environment. This is purely to simulate the deployment of live code to a server and is not meant to be a realistic use case for `Flask's` development environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnk2past%2Fdocker-ansible-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnk2past%2Fdocker-ansible-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnk2past%2Fdocker-ansible-demo/lists"}