AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Running a Playbook with JetPorch: A Quick Guide

By Luca Berton · Published 2024-01-01 · Category: installation

Explore a basic JetPorch playbook syntax example Playbooknstrating task execution using the shell module to print "hi".

Running a Playbook with JetPorch: A Quick Guide

JetPorch, the Jet Enterprise Professional Orchestrator, is a powerful IT automation platform designed for Linux and Mac systems. Whether you're configuring, deploying, orchestrating, patching, or executing various tasks, JetPorch provides a flexible and community-driven solution. In this guide, we'll explore how to run a playbook with JetPorch, covering installation and basic playbook syntax.

Installing JetPorch

JetPorch can be installed either from packages or built from source. As of the first release (Tech Preview 1 on September 29th, 2024), following the development branch is encouraged for the latest features and bug fixes. Monthly releases are expected, making it worthwhile to stay up-to-date.

Installing from Packages

For Rust users, JetPorch can be installed using the following command:

$ cargo binstall jetp

This command installs the jetp executable into ~/.cargo/bin. Verify the installation using:

$ which jetp
$ jetp --version

Installing from Source

Following the development branch ensures access to the latest features. Clone the repository and build JetPorch:

$ git clone <repository-url>
$ cargo build
$ cargo install --path .

See also: ansible_date_time: Access Date, Time & Timestamp Facts in Ansible

Understanding Plays

In JetPorch, a playbook is a YAML list consisting of one or more Play structures. Plays assign work or configurations to hosts using tasks and groups. The playbook structure is best understood by referring to the official documentation.

What's in a Name?

While the term "runbook" is common in IT, JetPorch adopts the term "playbook" from Ansible, using it as a sports analogy. Plays represent different strategies a team might employ in various situations. This adds a touch of fun to the concept, making it distinct from traditional IT metaphors.

Playbook Syntax

A basic playbook file might look like the example below:

# playbook1.yml
- name: sample playbook
  groups:
    - all
  tasks:
    - !shell
      cmd: echo hi

This playbook selects groups from inventory (in this case, all) and applies tasks to any host machine in those groups.

Running a Playbook

Once JetPorch is installed and you have a playbook ready, running it is a straightforward process. Use the following command:

$ jetp local --playbook playbook.yml

This command initiates the playbook execution, displaying detailed progress and results. The output includes information on roles, tasks, hosts, and the overall status of the playbook run.

# Example Output
----------------------------------------------------------
> playbook start: /path/to/playbook.yml
----------------------------------------------------------
> play: sample playbook
----------------------------------------------------------
> batch 1/1, 1 hosts
----------------------------------------------------------
> begin task: Shell
… localhost => running
✓ localhost => complete
----------------------------------------------------------
> play complete: sample playbook
----------------------------------------------------------

┌─────────┬─────┬─────┐ │Results │Items│Hosts│ ├─────────┼─────┼─────┤ │Roles │0 │ │ │Tasks │1 │1 │ ├─────────┼─────┼─────┤ │Matched │0 │0 │ │Created │0 │0 │ │Modified │0 │0 │ │Removed │0 │0 │ │Executed │1 │1 │ │Passive │0 │0 │ │Skipped │0 │0 │ ├─────────┼─────┼─────┤ │Unchanged│0 │0 │ │Changed │1 │1 │ │Failed │0 │0 │ └─────────┴─────┴─────┘

(✓) Actions were applied.

Congratulations! You've successfully run a playbook with JetPorch, automating tasks on your system. Feel free to explore additional features and customize playbooks according to your automation needs.

See also: ansible-inventory-grapher: Visualize Ansible Inventory as Graph (Guide)

Links

• https://github.com/jetporch/jetporchbasics/installing-from-packages • https://github.com/jetporch/jetporchplaybooks/plays • https://github.com/jetporch/jetporchconnectivity/local

Conclusion

In conclusion, JetPorch emerges as a robust and versatile IT automation platform, providing a seamless experience for configuration, deployment, orchestration, and task execution workflows on Linux and Mac systems. With a community-driven approach, JetPorch introduces an innovative take on playbooks, allowing users to execute strategies akin to plays in a sports game.

The installation process, whether from packages or source, is user-friendly, and staying updated with the development branch ensures access to the latest features and bug fixes. The playful terminology, drawing inspiration from sports analogies, adds a touch of fun to the traditionally technical realm of IT.

Understanding the playbook structure is crucial, and JetPorch's YAML-based syntax simplifies the creation of complex automation workflows. The provided example showcases the basic elements of a playbook, making it accessible to both beginners and experienced users.

Executing a playbook with JetPorch is a straightforward process, providing detailed progress and results. The comprehensive output offers insights into the roles, tasks, hosts, and overall status of the playbook run, empowering users to validate the success of their automation efforts.

As you delve further into the capabilities of JetPorch, exploring additional features and tailoring playbooks to your specific automation needs becomes an exciting prospect. Whether you're a seasoned IT professional or just starting, JetPorch opens up new possibilities for efficient and enjoyable IT automation. Embrace the power of JetPorch and elevate your automation game today.

See also: Ansible troubleshooting - Error sanity

Related Articles

switching users with Ansible becomemanaging inventory in Ansiblebuilding reusable Ansible roles

Category: installation

Watch the video: Running a Playbook with JetPorch: A Quick Guide — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home