{"id":15650600,"url":"https://github.com/garethr/puppet-docker-example","last_synced_at":"2025-10-08T08:45:22.580Z","repository":{"id":25390432,"uuid":"28819001","full_name":"garethr/puppet-docker-example","owner":"garethr","description":"An example of using the Puppet Docker module to manage containers, including Consul for service discovery","archived":false,"fork":false,"pushed_at":"2015-09-24T18:06:48.000Z","size":157,"stargazers_count":35,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-07T07:51:09.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/garethr.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}},"created_at":"2015-01-05T15:42:49.000Z","updated_at":"2020-07-15T16:39:52.000Z","dependencies_parsed_at":"2022-08-24T05:40:54.053Z","dependency_job_id":null,"html_url":"https://github.com/garethr/puppet-docker-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/garethr/puppet-docker-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethr%2Fpuppet-docker-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethr%2Fpuppet-docker-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethr%2Fpuppet-docker-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethr%2Fpuppet-docker-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garethr","download_url":"https://codeload.github.com/garethr/puppet-docker-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethr%2Fpuppet-docker-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278916444,"owners_count":26068090,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2024-10-03T12:35:11.196Z","updated_at":"2025-10-08T08:45:22.545Z","avatar_url":"https://github.com/garethr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Puppet Example\n\nThe [Puppet Docker module](https://forge.puppetlabs.com/garethr/docker)\nis a great way of installing and managing Docker on a host, but it also\nallows for some basic container management. This repo contains a fairly\nadvanced example using Puppet, Docker, Consul and Vagrant.\n\n## Usage\n\n    vagrant up --provider virtualbox\n    vagrant provision\n\nThis will take a little time as it launches three virtual machines and\ndownloads lots of software for them.\n\n## What happened?\n\nOnce up you should be able to access [10.20.1.13](http://10.20.1.13/)\nand it should print the text _client-appserver-2_.\n\nThe text is coming from a docker container on the host\n`client-appserver-2`, proxied through the nginx on `client-webserver-3`.\n\nSo far, not very interesting.\n\n## Next\n\n    INSTANCES=4 vagrant up --provider virtualbox\n    vagrant provision client-webserver-3\n\nHere we're launching a fourth virtual machine, another application\nserver. We're then kicking the webserver to update it's configuration.\n\nNote that you can increase the INSTANCES count until you run out of\ncomputer, it will launch alternating webservers and application servers\nand running `provision` on the webservers will add any new app servers\nthe proxy.\n\nVisit [10.20.1.13](http://10.20.1.13/) again and refresh a few times, it\nshould print _client-appserver-2_ or _client-appserber-4_, regularly\nswapping between the two.\n\n## Under the hood\n\n1. The first instance (`master-1`)  acts as a Consul master\n2. The second instance (`client-appserver-2`) installs docker, downloads\n   the official nginx docker image and runs a container based on that\n   image. It also regisers a service in Consul pointing at the container\n   port\n3. The third instance (`client-webserver-3`) installs nginx and checks\n   Consul (via the [Consul Hiera backend](https://github.com/lynxman/hiera-consul/))\n   for any services, automatically creating a proxy if it finds any\n\nFor those unfamiliar with the Puppet roles and profiles pattern the\ninteresting Puppet code is found in the [application\nprofile](modules/profiles/manifests/application.pp) and the [webserver\nprofile](modules/profiles/manifests/webserver.pp).\n\n## Improvements\n\nThis could be improved by running Puppet as an agent on each of the\nmachines, which would remove the need for the additional provisioning\nruns. You could also trigger a Puppet run whenever a new application\nserver is added by watching the Consul API with\n[Confd](https://github.com/kelseyhightower/confd) or similar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethr%2Fpuppet-docker-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarethr%2Fpuppet-docker-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethr%2Fpuppet-docker-example/lists"}