Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Rundeck – Methods to Run Ansible from Rundeck

Here’s a complete guide to running Ansible Playbooks using Rundeck, covering all supported methods, including what you’ve done, plus troubleshooting options and best practices.


โœ… Goal

Run an Ansible Playbook (web.yaml) on remote hosts from Rundeck.


๐Ÿงฐ Prerequisites

  • Ansible installed on Rundeck server (ansible, ansible-playbook)
  • Playbook and inventory exist, e.g.:
    • /tmp/ansible/web.yaml
    • /tmp/ansible/inventory
  • Hosts reachable via SSH (key-based preferred)
  • Rundeck has access to private key

โœ… Methods to Run Ansible from Rundeck


โœ… Method 1: Ansible Plugin (Node Step or Workflow Step)

Rundeck Plugin: Ansible Plugin for Rundeck

Best for: Structured jobs with SSH auth and node filtering.

Configuration

  • Plugin Step Type: Ansible Playbook Workflow Node Step
  • Playbook: web.yaml
  • Inventory: -i /tmp/ansible/inventory
  • Auth: Private key or SSH password
  • User: ubuntu
  • Extra vars (optional): foo=bar
  • Set: Use become: Yes (if needed)

๐Ÿ” Troubleshooting

  • Set Node Filter to .* (or name: .*) to apply job globally
  • Rundeck will pass --limit <node> unless you’re careful
  • Inventory must include same hostnames/IPs as Rundeck nodes

Scree -1

#inventory code
more inventory
[web]
65.2.153.2
52.66.236.156
13.232.137.62
13.201.133.240

[db]
3.7.65.62

#web.yaml
---
- name: Update web servers
  hosts: web

  tasks:
  - name: Install Apache in ubuntu
    ansible.builtin.apt:
      name: "git"
      state: latest
  - name: Copy index.html
    ansible.builtin.copy:
      src: index.html
      dest: /tmp/index.html
Code language: PHP (php)

โœ… Method 2: Ansible as Command Step (Central Execution)

Run centrally from Rundeck server (not per node). This avoids node filtering issues.

Example

ansible-playbook -i /tmp/ansible/inventory /tmp/ansible/web.yaml -u ubuntu -b --private-key=/tmp/ansible/key.pem
Code language: JavaScript (javascript)

Steps

  • Add a Command Step
  • Shell command as above
  • Optional: Make key available using Secure Option

โœ… When to Use

  • You donโ€™t need per-node execution
  • Want Rundeck to just centrally launch playbooks

โœ… Method 3: Script Step with Arguments

Same as Method 2, but using a bash script.

Example

Create script /tmp/run_ansible.sh:

#!/bin/bash
ansible-playbook -i /tmp/ansible/inventory /tmp/ansible/web.yaml -u ubuntu -b --private-key=/tmp/ansible/key.pem
Code language: JavaScript (javascript)

Set Rundeck step type: Script file or inline


โœ… Method 4: Ansible Ad-Hoc Step (Ansible Plugin)

You can also use:

  • Ansible Ad-Hoc Command Node Step
  • For one-liner tasks (e.g., apt update, ping, copy)

Example module: ping, shell, copy


โœ… Method 5: Job with Embedded Inventory (YAML)

In Rundeck Project configuration, embed static inventory.

Example:

[web]
192.168.1.10 ansible_user=ubuntu

Then playbook can use hosts: web, and Rundeck calls it with --limit to match that.


โœ… Method 6: Dynamic Inventory Integration

Use AWS/GCP inventory plugin or a custom dynamic inventory script.

Steps:

  • Create a script like aws_ec2.py or a custom script
  • In Ansible arguments: -i /tmp/ansible/my_dynamic_inventory.py
  • Make sure script is executable and returns correct JSON

๐Ÿงช Bonus: Add a Debug Step Before Playbook

Add a shell step before Ansible call:

ansible -i /tmp/ansible/inventory web --list-hosts
Code language: PHP (php)

This lets you verify what Ansible sees at runtime.


๐Ÿงพ Sample Rundeck Job YAML (Centrally Executed)

- defaultTab: nodes
  description: Run Ansible playbook centrally
  executionEnabled: true
  id: 1234-ansible-job
  loglevel: INFO
  name: run-ansible-central
  nodeFilterEditable: false
  scheduleEnabled: true
  sequence:
    commands:
    - description: Run Ansible centrally
      exec: ansible-playbook -i /tmp/ansible/inventory /tmp/ansible/web.yaml -u ubuntu -b --private-key=/tmp/ansible/key.pem
  nodefilters:
    dispatch:
      threadcount: 1
      keepgoing: false
    filter: ".*"
Code language: JavaScript (javascript)

โœ… Summary Table

MethodDescriptionBest Use Case
๐Ÿ”Œ Plugin (Node Step)Uses Rundeck Ansible plugin to run playbook on matched nodesWhen your inventory matches Rundeck nodes
๐Ÿ–ฅ๏ธ Command StepRuns Ansible centrally from Rundeck serverFor single control execution
๐Ÿงพ Script StepShell script wraps Ansible callRepeatable, customizable
โšก Ad-Hoc StepUse Ansible module like ping or shellFor one-time actions
๐Ÿ“‚ Embedded InventoryStatic inventory within projectWhen inventory doesn’t change
๐Ÿ” Dynamic InventoryExternal inventory script (AWS, GCP, etc.)For cloud infra or frequent host changes

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 No-Code Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, no-code platforms have become essential for businesses and individuals looking to build powerful applications, websites, and automations without the need for programming knowledge. These…

Read More

Top 10 AI Training Data Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI training data platforms have become the backbone of successful machine learning (ML) and artificial intelligence (AI) projects. These platforms streamline the process of…

Read More

Top 10 AI Poster & Flyer Design Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI-powered poster and flyer design tools have revolutionized the way businesses, marketers, educators, and creators produce visually stunning promotional materials. These tools leverage artificial…

Read More

Top 10 Collaboration Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, collaboration platforms are more essential than ever. As remote and hybrid work environments continue to thrive, having the right collaboration tool can be the…

Read More

The 5 Most Popular Email APIs Among Developers In 2026

In the modern world, where everything is going digital, email is among the most important means of communication both in personal and business life. As a developer,…

Read More

Top 10 Construction Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction Construction Management Software (CMS) has become indispensable in 2026 for efficiently handling various aspects of construction projects, ranging from budgeting, scheduling, resource allocation, project tracking, to…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x