Puppet in Docker Configuring Puppet containers using Docker compose

0 votes
I want to launch a stack consisting of Puppet Server, PuppetDB, a PostgresDB container for PuppetDB and the open source dashboards Puppetboard and Puppet Explorer in Docker containers.

I heard this could be easily done using docker-compose. How can i do this using docker-compose?

Should i specify all these configurations in the docker-compose.yaml file?

somebody please help!
Aug 20, 2019 in Puppet by Sam
• 6,260 points
1,873 views

1 answer to this question.

0 votes

Using Docker compose you can define a set of containers, along with their relationships, in a YAML file. And then use the docker-compose CLI to launch and manage them.

For this example there's a compose file using the version 2 schema. This means you will need at least Docker Engine 1.10 and Compose 1.6.

Here's the docker-compose.yml for the your scenario:

version: '2'
services:
     puppet:
     container_name: puppet
     hostname: puppet
     image: puppet/puppetserver
     ports:
        - 8140
     volumes:
        - ./code:/etc/puppetlabs/code/
        - ./puppet/ssl:/etc/puppetlabs/puppet/ssl/
        - ./puppet/serverdata:/opt/puppetlabs/server/data/puppetserver/
     #environment:
     # - PUPPETDB_SERVER_URLS=https://puppetdb.local:8081
     #links:
     # - puppetdb:puppetdb.local
puppetdb-postgres:
       container_name: postgres
       image: puppet/puppetdb-postgres
       environment:
          - POSTGRES_PASSWORD=puppetdb
          - POSTGRES_USER=puppetdb
       expose:
          -5432
       volumes:
          - ./puppetdb-postgres/data:/var/lib/postgresql/data/
puppetdb:
       hostname: puppetdb
       image: puppet/puppetdb
       ports:
          - 8080
          - 8081
       volumes:
          - ./puppetdb/ssl:/etc/puppetlabs/puppet/ssl/
puppetboard:
       image: puppet/puppetboard
       ports:
          - 8000
puppetexplorer:
       image: puppet/puppetexplorer
       ports:
          - 80
       read_only: true
answered Aug 20, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

Puppet in Docker : How do i launch puppet agents (test agents) in Docker containers?

You could connect any agents to the ...READ MORE

answered Aug 20, 2019 in Puppet by Sirajul
• 59,230 points
1,833 views
0 votes
1 answer

Puppet in Docker : How do i create puppet containers?

For creating puppet containers, first we need ...READ MORE

answered Aug 20, 2019 in Puppet by Sirajul
• 59,230 points
2,214 views
0 votes
1 answer

Is it possible to install puppet agent in a docker container on linux?

Hey @Janice, this is pretty simple. Create ...READ MORE

answered Mar 12, 2019 in Puppet by Jason
1,516 views
0 votes
1 answer

How do I enable puppet collection repository in puppet if I am using Puppet 6.7?

In Puppet6.7 you have to enable Puppet ...READ MORE

answered Jul 31, 2019 in Puppet by Sirajul
• 59,230 points
1,276 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,714 views
0 votes
1 answer

Puppet+Docker: Using Docker-Compose with Puppet

Docker Compose describes a set of containers ...READ MORE

answered Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
3,414 views
0 votes
1 answer

Puppet in Docker : Benefit of using puppet in docker

Here's to how this approach proves beneficial: One ...READ MORE

answered Aug 19, 2019 in Puppet by Sirajul
• 59,230 points
662 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP