# \#playbook

**URL:** https://forum.ansible.com/tag/playbook/10.md

[Latest](https://forum.ansible.com/latest.md) · [Categories](https://forum.ansible.com/categories.md) · [Tags](https://forum.ansible.com/tags.md)

---

## [Run a remote command from a template \*file\*](https://forum.ansible.com/t/run-a-remote-command-from-a-template-file/46319)

<div class="topic-metadata">

**Author:** [@mirabilos](https://forum.ansible.com/u/mirabilos)\
**Replies:** 12\
**Last updated:** [October 14, 2026, 10:35pm UTC](https://forum.ansible.com/t/run-a-remote-command-from-a-template-file/46319 "2026-10-14T22:35:06Z")

</div>

I need to run a few lines of shell on a remote system, and I find YAML more than awkward to use for this and would prefer to put this into a foo.sh.j2 file instead. Now I could do the dance: stat to test if a remote d…

---

## [Creating runtime dynamic inventory - How to use group\_vars from different stages](https://forum.ansible.com/t/creating-runtime-dynamic-inventory-how-to-use-group-vars-from-different-stages/46382)

<div class="topic-metadata">

**Author:** [@Jonny](https://forum.ansible.com/u/Jonny)\
**Replies:** 5\
**Last updated:** [October 6, 2026, 8:40am UTC](https://forum.ansible.com/t/creating-runtime-dynamic-inventory-how-to-use-group-vars-from-different-stages/46382 "2026-10-06T08:40:24Z")

</div>

Hello community, In an Ansible project, I have a dynamic inventory generated at runtime using a Jinja2 template, which I then load using refresh inventory. The inventory is generated because I use different environments…

---

## [IF/Else-Statement at vars](https://forum.ansible.com/t/if-else-statement-at-vars/46381)

<div class="topic-metadata">

**Author:** [@Jonny](https://forum.ansible.com/u/Jonny)\
**Replies:** 15\
**Last updated:** [October 2, 2026, 10:06pm UTC](https://forum.ansible.com/t/if-else-statement-at-vars/46381 "2026-10-02T22:06:01Z")

</div>

Hi community, I heard somewhere that you shouldn’t use an if-else statement in jinja2 format inside a variable. Unfortunately, I can’t find anything about this in any best practices guide. Is this statement correct? I…

---

## [Deleting single or double quotation marks in a string using REGEX](https://forum.ansible.com/t/deleting-single-or-double-quotation-marks-in-a-string-using-regex/2628)

<div class="topic-metadata">

**Author:** [@Mojtaba](https://forum.ansible.com/u/Mojtaba)\
**Replies:** 5\
**Last updated:** [August 20, 2026, 1:55pm UTC](https://forum.ansible.com/t/deleting-single-or-double-quotation-marks-in-a-string-using-regex/2628 "2026-08-20T13:55:27Z")

</div>

Hello, Here is my playbook. - name: Remove Quotes from Variable hosts: localhost gather\_facts: false vars: original\_text: "this is \\"Hello'World\\"" tasks: - name: Display Original Text debug: …

---

## [Playbooks are not posted in site](https://forum.ansible.com/t/playbooks-are-not-posted-in-site/45962)

<div class="topic-metadata">

**Author:** [@Dayadevi\_Karunanidhi](https://forum.ansible.com/u/Dayadevi_Karunanidhi)\
**Replies:** 4\
**Last updated:** [June 24, 2026, 8:25am UTC](https://forum.ansible.com/t/playbooks-are-not-posted-in-site/45962 "2026-06-24T08:25:41Z")

</div>

I am trying to do public posting of my collection. Collection is getting posting. But I cannot see my playbooks in My playbooks are in the artifact/.gz files. But it is not listing in Ansible Galaxy

---

## [How Do I Launch Two Different Playbooks or Tasks at the Same Time?](https://forum.ansible.com/t/how-do-i-launch-two-different-playbooks-or-tasks-at-the-same-time/45633)

<div class="topic-metadata">

**Author:** [@clerambeau370](https://forum.ansible.com/u/clerambeau370)\
**Replies:** 11\
**Last updated:** [April 7, 2026, 11:08am UTC](https://forum.ansible.com/t/how-do-i-launch-two-different-playbooks-or-tasks-at-the-same-time/45633 "2026-04-07T11:08:03Z")

</div>

Hello. I have two different playbooks. Each refreshes an Oracle database from another. Different sets. Unrelated. I have coded it sequentially to begin with: 1. Refresh A from B; 2. Refresh D from C; They run fine, but…

---

## [playbook to mount cephfs filesystem  ](https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554)

<div class="topic-metadata">

**Author:** [@lezard\_kein](https://forum.ansible.com/u/lezard_kein)\
**Replies:** 1\
**Last updated:** [March 19, 2026, 9:15am UTC](https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554 "2026-03-19T09:15:11Z")

</div>

Hi, I have a strange behaviour .. probably I make some mistake. I try to had share directories to my fstab directly with ansible through a playbook … I have a working configuration on my cluster nodes /etc/ceph/ceph…

---

## [Are module, role and play argument validation the same? (argument\_spec)](https://forum.ansible.com/t/are-module-role-and-play-argument-validation-the-same-argument-spec/45377)

<div class="topic-metadata">

**Author:** [@mardonner](https://forum.ansible.com/u/mardonner)\
**Replies:** 6\
**Last updated:** [February 23, 2026, 5:03pm UTC](https://forum.ansible.com/t/are-module-role-and-play-argument-validation-the-same-argument-spec/45377 "2026-02-23T17:03:27Z")

</div>

Hey, I recently discovered role argument validation and started to include meta/argument\_specs.yml in my roles. Some of the input arguments of my role are sensitive values, so I was looking through the documentation to s…

---

## [On the philosophy of task naming](https://forum.ansible.com/t/on-the-philosophy-of-task-naming/45096)

<div class="topic-metadata">

**Author:** [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Replies:** 14\
**Last updated:** [January 25, 2026, 6:42pm UTC](https://forum.ansible.com/t/on-the-philosophy-of-task-naming/45096 "2026-01-25T18:42:44Z")

</div>

Sometimes I don’t think to much about it so I end up using different styles of task naming in the same project, for example: Install the package (imperative form) Installation of the package (noun form) Installing the …

---

## [Test plugin version error : could not compare 'str' and 'int'](https://forum.ansible.com/t/test-plugin-version-error-could-not-compare-str-and-int/45158)

<div class="topic-metadata">

**Author:** [@fghebert](https://forum.ansible.com/u/fghebert)\
**Replies:** 2\
**Last updated:** [January 23, 2026, 2:11pm UTC](https://forum.ansible.com/t/test-plugin-version-error-could-not-compare-str-and-int/45158 "2026-01-23T14:11:23Z")

</div>

Hi, Here is an abstract of my role: - name: Get Git's version ansible.builtin.shell: "git --version | awk -F' ' { print $3 }'" register: base\_git\_installed\_version when: base\_git\_installed.rc == 0 - name: Debug …

---

## [Explicitely use role defaults](https://forum.ansible.com/t/explicitely-use-role-defaults/44958)

<div class="topic-metadata">

**Author:** [@VannTen](https://forum.ansible.com/u/VannTen)\
**Replies:** 8\
**Last updated:** [December 8, 2025, 3:09pm UTC](https://forum.ansible.com/t/explicitely-use-role-defaults/44958 "2025-12-08T15:09:06Z")

</div>

Hello, I’m working on a playbook where I’d like to fetch some files from my hosts to the control node. I want the destination (on the control node) to be controlled by a variable local\_release\_dir in the localhost cont…

---

## [ansible-playbook doesn't run handlers if play has different tag](https://forum.ansible.com/t/ansible-playbook-doesnt-run-handlers-if-play-has-different-tag/44481)

<div class="topic-metadata">

**Author:** [@alphabetical](https://forum.ansible.com/u/alphabetical)\
**Replies:** 5\
**Last updated:** [November 16, 2025, 1:23pm UTC](https://forum.ansible.com/t/ansible-playbook-doesnt-run-handlers-if-play-has-different-tag/44481 "2025-11-16T13:23:36Z")

</div>

I have encountered some unexpected ansible-playbook behavior with respect to play tags and role tags. I’m trying to understand if this is an Ansible bug or this is a limitation of using tags, so I followed the recommenda…

---

## [Hosts missing in playbook](https://forum.ansible.com/t/hosts-missing-in-playbook/44842)

<div class="topic-metadata">

**Author:** [@starflighter](https://forum.ansible.com/u/starflighter)\
**Replies:** 2\
**Last updated:** [November 14, 2025, 1:36pm UTC](https://forum.ansible.com/t/hosts-missing-in-playbook/44842 "2025-11-14T13:36:11Z")

</div>

Hi all, I have some strange behavior with the execution of a playbook. If i run ansible-playbook \<playbook\> --list-hosts i get 75 hosts. That is the number of hosts i am expecting. But if i run the playbook without …

---

## [Why does dnf state: absent remove packages depending on the package too?](https://forum.ansible.com/t/why-does-dnf-state-absent-remove-packages-depending-on-the-package-too/44764)

<div class="topic-metadata">

**Author:** [@firefly-sudo](https://forum.ansible.com/u/firefly-sudo)\
**Replies:** 1\
**Last updated:** [October 30, 2025, 2:19pm UTC](https://forum.ansible.com/t/why-does-dnf-state-absent-remove-packages-depending-on-the-package-too/44764 "2025-10-30T14:19:23Z")

</div>

Using this task, I want to remove the patch package from my servers. But after running the task, dkms is also uninstalled. Dkms depends on the patch package. - name: "Remove now unused patch package" ansible.buil…

---

## [When condition expecting string instead of bool](https://forum.ansible.com/t/when-condition-expecting-string-instead-of-bool/44698)

<div class="topic-metadata">

**Author:** [@carnaiz\_fastly](https://forum.ansible.com/u/carnaiz_fastly)\
**Replies:** 2\
**Last updated:** [October 16, 2025, 9:27pm UTC](https://forum.ansible.com/t/when-condition-expecting-string-instead-of-bool/44698 "2025-10-16T21:27:13Z")

</div>

Playbook when condition seems to be expecting a string, where it should take a boolean We’re updating our ansible playbooks from 2.10 to 2.19 (ansible 12.0.0). I’ve handled issues brought up by ansible-lint (v25.9.2). …

---

## [Is the Playbook I Wrote Secure and Effective?](https://forum.ansible.com/t/is-the-playbook-i-wrote-secure-and-effective/44636)

<div class="topic-metadata">

**Author:** [@HuseynNajafli](https://forum.ansible.com/u/HuseynNajafli)\
**Replies:** 4\
**Last updated:** [October 9, 2025, 5:14am UTC](https://forum.ansible.com/t/is-the-playbook-i-wrote-secure-and-effective/44636 "2025-10-09T05:14:34Z")

</div>

Hello everyone, This is my first time posting here, and I’m quite excited. I’ve written a playbook and would like to know whether it achieves the intended results fully, and if there’s anything I should improve or opti…

---

## [SELinux prevents playbooks from ssh-ing ](https://forum.ansible.com/t/selinux-prevents-playbooks-from-ssh-ing/44565)

<div class="topic-metadata">

**Author:** [@Michael\_Marrone](https://forum.ansible.com/u/Michael_Marrone)\
**Replies:** 7\
**Last updated:** [October 1, 2025, 12:09pm UTC](https://forum.ansible.com/t/selinux-prevents-playbooks-from-ssh-ing/44565 "2025-10-01T12:09:31Z")

</div>

Hello! My problem is on a disconnected system so I can’t cut & paste. It’s also my first posting, so I don’t have the formatting that everyone likes, my apologies. I am having an issue where a playbook will not run on…

---

## [Services and TLS certificates - how to configure step by step?](https://forum.ansible.com/t/services-and-tls-certificates-how-to-configure-step-by-step/44483)

<div class="topic-metadata">

**Author:** [@zeropage](https://forum.ansible.com/u/zeropage)\
**Replies:** 7\
**Last updated:** [September 26, 2025, 4:02pm UTC](https://forum.ansible.com/t/services-and-tls-certificates-how-to-configure-step-by-step/44483 "2025-09-26T16:02:10Z")

</div>

My CA issues certificates for my TLS-encrypted connections. For example, for rsyslog, stunnel, or Prometheus node exporter. I configure all these services with Ansible roles. However, I have a fundamental problem with th…

---

## [How to list the required vault ids for playing a playbook, like list-tags and list-tasks](https://forum.ansible.com/t/how-to-list-the-required-vault-ids-for-playing-a-playbook-like-list-tags-and-list-tasks/44552)

<div class="topic-metadata">

**Author:** [@gzm55](https://forum.ansible.com/u/gzm55)\
**Replies:** 8\
**Last updated:** [September 26, 2025, 3:20pm UTC](https://forum.ansible.com/t/how-to-list-the-required-vault-ids-for-playing-a-playbook-like-list-tags-and-list-tasks/44552 "2025-09-26T15:20:37Z")

</div>

how to list the required vault ids for playing a playbook, like list-tags and list-tasks?

---

## [Splitting a role in 2 but need to pass fact from one to the other](https://forum.ansible.com/t/splitting-a-role-in-2-but-need-to-pass-fact-from-one-to-the-other/44526)

<div class="topic-metadata">

**Author:** [@NeilS](https://forum.ansible.com/u/NeilS)\
**Replies:** 1\
**Last updated:** [September 22, 2025, 1:52pm UTC](https://forum.ansible.com/t/splitting-a-role-in-2-but-need-to-pass-fact-from-one-to-the-other/44526 "2025-09-22T13:52:30Z")

</div>

I’ve currently got a role that runs server updates. One of the facts it sets in there is “updates”. This can then be used as “updates.stdout\_lines” to determine if there were any updates. There are 2 steps at the end of …

---

## [AWX 23.8.1 : getting error "Invalid linkname for tarfile member"](https://forum.ansible.com/t/awx-23-8-1-getting-error-invalid-linkname-for-tarfile-member/6242)

<div class="topic-metadata">

**Author:** [@SaravanaSelvaraj](https://forum.ansible.com/u/SaravanaSelvaraj)\
**Replies:** 1\
**Last updated:** [September 12, 2025, 10:00pm UTC](https://forum.ansible.com/t/awx-23-8-1-getting-error-invalid-linkname-for-tarfile-member/6242 "2025-09-12T22:00:25Z")

</div>

Getting Invalid linkname for tarfile member while running a shared role job. Hello Community, We are using shared role concept to run the jobs in AWX and we are getting a below error while synching the project. The pro…

---

## [Setting environment variables at the task level](https://forum.ansible.com/t/setting-environment-variables-at-the-task-level/44373)

<div class="topic-metadata">

**Author:** [@RSchulze](https://forum.ansible.com/u/RSchulze)\
**Replies:** 2\
**Last updated:** [August 27, 2025, 9:26am UTC](https://forum.ansible.com/t/setting-environment-variables-at-the-task-level/44373 "2025-08-27T09:26:14Z")

</div>

Hi, I recently updated my ansible to version 2.19 and have been getting the following warning: \[WARNING\]: Found variable using reserved name 'environment'. The thing is that I’m actually trying to set environment vari…

---

## [ansible-plabook keeps saying ansible-vault variables are undefined!!](https://forum.ansible.com/t/ansible-plabook-keeps-saying-ansible-vault-variables-are-undefined/44284)

<div class="topic-metadata">

**Author:** [@Gittes](https://forum.ansible.com/u/Gittes)\
**Replies:** 13\
**Last updated:** [August 15, 2025, 1:23am UTC](https://forum.ansible.com/t/ansible-plabook-keeps-saying-ansible-vault-variables-are-undefined/44284 "2025-08-15T01:23:16Z")

</div>

Hello everyone! I’m working on a project for a company I am working for. Whenever I use ansible-playbook with three variable files, two files are encrypted with ansible-vault and each file has one variable. The variabl…

---

## [Really can't do this in Ansible?](https://forum.ansible.com/t/really-cant-do-this-in-ansible/43926)

<div class="topic-metadata">

**Author:** [@Daniel\_Mocsari](https://forum.ansible.com/u/Daniel_Mocsari)\
**Replies:** 8\
**Last updated:** [July 23, 2025, 6:53am UTC](https://forum.ansible.com/t/really-cant-do-this-in-ansible/43926 "2025-07-23T06:53:35Z")

</div>

Hello! I’m seeking a way to write a playbook that fails securely if any issue arises on any host. I know these parameters: max\_fail\_percentage: 0 any\_errors\_fatal: true The challenge is ensuring logging and fact-savi…

---

## [Error when using proxy env vars in playbook to install package](https://forum.ansible.com/t/error-when-using-proxy-env-vars-in-playbook-to-install-package/43947)

<div class="topic-metadata">

**Author:** [@jeferson\_nascimento](https://forum.ansible.com/u/jeferson_nascimento)\
**Replies:** 5\
**Last updated:** [December 9, 2024, 10:18am UTC](https://forum.ansible.com/t/error-when-using-proxy-env-vars-in-playbook-to-install-package/43947 "2024-12-09T10:18:52Z")

</div>

Opa tudo bom, espero que sim.. Estou com uma dúvida em validar playbooks, para automatizar download via web passando pelo proxy. Sendo que copiando, direto do site Ansible o proxy ou o comando mesmo assim não consigo va…

---

## [meta: end\_play von einer Kondition abhängig machen und Playbook beenden](https://forum.ansible.com/t/meta-end-play-von-einer-kondition-abhangig-machen-und-playbook-beenden/43901)

<div class="topic-metadata">

**Author:** [@oliverbrandt](https://forum.ansible.com/u/oliverbrandt)\
**Replies:** 2\
**Last updated:** [July 18, 2025, 6:44am UTC](https://forum.ansible.com/t/meta-end-play-von-einer-kondition-abhangig-machen-und-playbook-beenden/43901 "2025-07-18T06:44:53Z")

</div>

Hallo zusammen, ich code gerade ein Playbook, in dem ich mit einer Kondition das Playbook beenden möchte. name: Patching Servers hosts: all gather\_facts: yes become: true tasks: name: Check, if system is up-to…

---

## [Ansible playbook to restart if needed](https://forum.ansible.com/t/ansible-playbook-to-restart-if-needed/5922)

<div class="topic-metadata">

**Author:** [@jnilsson](https://forum.ansible.com/u/jnilsson)\
**Replies:** 8\
**Last updated:** [July 3, 2025, 10:44am UTC](https://forum.ansible.com/t/ansible-playbook-to-restart-if-needed/5922 "2025-07-03T10:44:50Z")

</div>

I’m trying to write a playbook that installs updates and then reboots a linux server if needed. For now I’m just working on dnf based systems. The dnf update works, but the reboot doesn’t. So far, I have come up with thi…

---

## [How to copy a folder between two virtual machines?](https://forum.ansible.com/t/how-to-copy-a-folder-between-two-virtual-machines/42695)

<div class="topic-metadata">

**Author:** [@virusek391](https://forum.ansible.com/u/virusek391)\
**Replies:** 6\
**Last updated:** [May 17, 2025, 1:24pm UTC](https://forum.ansible.com/t/how-to-copy-a-folder-between-two-virtual-machines/42695 "2025-05-17T13:24:41Z")

</div>

Hi, I have vritual machine with Ansible. Now i want copy data from directory certyfikaty on svrhost to directory /svr/vaultwarden/cert folder on svrdocker. I don’t know what’s wrong, but below code dosen;t work - name…

---

## [Understanding become: true and become\_user: root not working in custom GCP connection setup](https://forum.ansible.com/t/understanding-become-true-and-become-user-root-not-working-in-custom-gcp-connection-setup/42685)

<div class="topic-metadata">

**Author:** [@SaravanaSelvaraj](https://forum.ansible.com/u/SaravanaSelvaraj)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 1:46pm UTC](https://forum.ansible.com/t/understanding-become-true-and-become-user-root-not-working-in-custom-gcp-connection-setup/42685 "2025-05-16T13:46:46Z")

</div>

become\_user: root is not working as expected. Dear community, In the background, We have established the connectivity to the GCP VMs using the Service account JSON with below command # --- Connect using OS Login and s…

---

## [Ansible output jinja2 loop to a different files](https://forum.ansible.com/t/ansible-output-jinja2-loop-to-a-different-files/42264)

<div class="topic-metadata">

**Author:** [@Shiraz\_Kamal](https://forum.ansible.com/u/Shiraz_Kamal)\
**Replies:** 2\
**Last updated:** [April 30, 2025, 11:28am UTC](https://forum.ansible.com/t/ansible-output-jinja2-loop-to-a-different-files/42264 "2025-04-30T11:28:10Z")

</div>

I have the following in my vars file. aux: "SHR" cluster\_nodes: - { node\_name: sudora123a, node\_num: 1, inst\_num: "123A" } - { node\_name: sudora123b, node\_num: 2, inst\_num: "123B" } I am trying to loop t…

[Next page](https://forum.ansible.com/tag/playbook/10.md?match_all_tags=true&page=1&tags%5B%5D=playbook)
