Puppet in Docker How can I use docker to create a container that has puppet inside and can perform any instruction just like how a Puppet Manifest does

0 votes
Aug 19, 2019 in Puppet by Liana
815 views

1 answer to this question.

0 votes

Run the following docker command:

$ docker run --name apply-test puppet/puppet-agent apply -e 'file { "/tmp/adhoc": content => "Written by Puppet" }'

This will pull the puppet/puppet-agent image from Docker Hub and use Puppet to apply a change, namely creating a file in /tmp/adhoc containing the words, “Written by Puppet.”

If you now run a diff on that container, you’ll see what’s changed from the original image. 

In this case, upon running, the container created new folders and added content to them, including the /tmp/adhoc file:

root@node02:~# docker diff apply-test
C /etc
C /etc/puppetlabs
C /etc/puppetlabs/puppet
A /etc/puppetlabs/puppet/ssl
A /etc/puppetlabs/puppet/ssl/certificate_requests
A /etc/puppetlabs/puppet/ssl/certs
A /etc/puppetlabs/puppet/ssl/private
A /etc/puppetlabs/puppet/ssl/private_keys
A /etc/puppetlabs/puppet/ssl/public_keys
...
C /tmp
A /tmp/adhoc

This approach is much faster when compared to the conventional way of creating a separate puppet node.

answered Aug 19, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

Does puppet forge have modules that i can use to Install LAMP stack?

Puppet forge has modules for installing and ...READ MORE

answered Jul 30, 2019 in Puppet by Sirajul
• 59,230 points
892 views
0 votes
1 answer
0 votes
1 answer

Puppet in Docker : How to mount Puppet on a CentOS container?

Run the following command: docker run --volumes-from=puppet-agent centos ...READ MORE

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

Puppet in Docker: Can a docker container use Puppet only at Run-time?

Docker provides a solution to this problem ...READ MORE

answered Aug 19, 2019 in Puppet by Sirajul
• 59,230 points
760 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,720 views
0 votes
1 answer

Puppet+Docker: How do i configure my docker container to use a NFS volume?

docker_volume { 'nfs-volume': ensure => ...READ MORE

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

Puppet+Docker: How do i configure my docker container to use a NFS volume through a Hiera config file?

If using Hiera, configure the docker::volumes class in the ...READ MORE

answered Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
930 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