Answer: Run only one task and handler from ansible playbook
Roy
Posted on September 29, 2020
It is possible to run separate role (from roles/
dir):
ansible -i stage.yml -m include_role -a name=create-os-user localhost
and separate task file:
ansible -i stage.yml -m include_tasks -a file=tasks/create-os-user.yml localhost
If you externalize tasks from role to root tasks/
directory (reuse is achieved by import_tasks: ../../../tasks/create-os-user.yml
) you ccan run…
💖 💪 🙅 🚩
Roy
Posted on September 29, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
kubernetes Setting Up a Production-Ready Kubernetes Cluster with RKE2 in vSphere Using Terraform
November 29, 2024