Help with Bolt Puppet DSL example

Skip to first unread message

Sandra Schlichting

Nov 17, 2021, 3:42:45 PM11/17/21
to Puppet Users

Dear all =)

I would like to learn Bolt with Puppet DSL, so I was wondering if someone could get me started with an example that:

* logs into a Linux host
* touch new_file_as_user
* sudo
* touch file_as_root

That would be very much appreciated =)

Sandra =)

Martin Alfke

Nov 18, 2021, 6:59:19 AM11/18/21
Hi Sandra,

Bolt has two options: tasks and plans.
Tasks consist of a Script (Shell, Powershell, Python, Ruby) and a .json file.
Plans are written in Puppet DSL.

Main difference:
Tasks run workflow actions like stop a service, do something and restart the service.
Plans are used to control tasks over a number of nodes.

In you case I would head to a task.
When using pdf, you can run pdf new task within a module.

You can then use bolt to execute a task:

bolt task run <task name> —nodes <comma separated node list>

The task istself:
touch <file>
sudo touch <file>


You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Sandra Schlichting

Nov 19, 2021, 7:59:37 AM11/19/21
to Puppet Users
Dear Martin,

It sure did. Thanks a lot =)

Sandra =)
Reply all
Reply to author
0 new messages