# \#role

**URL:** https://forum.ansible.com/tag/role/155.md

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

---

## [Proposal: document role "return variables" in argument\_specs.yml (like module RETURN)](https://forum.ansible.com/t/proposal-document-role-return-variables-in-argument-specs-yml-like-module-return/46469)

<div class="topic-metadata">

**Author:** [@spetrosi](https://forum.ansible.com/u/spetrosi)\
**Replies:** 22\
**Last updated:** [October 16, 2026, 4:35pm UTC](https://forum.ansible.com/t/proposal-document-role-return-variables-in-argument-specs-yml-like-module-return/46469 "2026-10-16T16:35:33Z")

</div>

Hello everyone, I’d like to propose way for roles to document the variables they set, rendered as a table on the role’s documentation page the same way modules document their return values today. I initiated this in an…

---

## [Should automation developers be starting with role-only collections?](https://forum.ansible.com/t/should-automation-developers-be-starting-with-role-only-collections/46251)

<div class="topic-metadata">

**Author:** [@Jeff\_Pullen](https://forum.ansible.com/u/Jeff_Pullen)\
**Replies:** 21\
**Last updated:** [September 16, 2026, 8:17am UTC](https://forum.ansible.com/t/should-automation-developers-be-starting-with-role-only-collections/46251 "2026-09-16T08:17:36Z")

</div>

Should automation developers be starting with role-only collections? I genuinely cannot answer that, and following up on my earlier posts about group two (the folks testing roles and playbooks rather than Python modules…

---

## [Galaxy Role Import: Namespace & GitHub User / Org Mismatch](https://forum.ansible.com/t/galaxy-role-import-namespace-github-user-org-mismatch/45995)

<div class="topic-metadata">

**Author:** [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Replies:** 0\
**Last updated:** [June 30, 2026, 7:25am UTC](https://forum.ansible.com/t/galaxy-role-import-namespace-github-user-org-mismatch/45995 "2026-06-30T07:25:32Z")

</div>

Summary This guide explains how to successfully import your role into galaxy.ansible.com when the role namespace name and GitHub user or organization slug do not match. For example, the GitHub organization slug is my-am…

---

## [Role in collection cannot find module in the same collection](https://forum.ansible.com/t/role-in-collection-cannot-find-module-in-the-same-collection/45676)

<div class="topic-metadata">

**Author:** [@ab203972](https://forum.ansible.com/u/ab203972)\
**Replies:** 9\
**Last updated:** [April 16, 2026, 6:16pm UTC](https://forum.ansible.com/t/role-in-collection-cannot-find-module-in-the-same-collection/45676 "2026-04-16T18:16:58Z")

</div>

We have an internal collection with roles, one of which lists available updates, and another that actually performs the updates, excluding necessary packages. I am trying to tweak the role that lists updates so that it d…

---

## [Adding insights compliance policy](https://forum.ansible.com/t/adding-insights-compliance-policy/45455)

<div class="topic-metadata">

**Author:** [@d3adin](https://forum.ansible.com/u/d3adin)\
**Replies:** 0\
**Last updated:** [February 27, 2026, 5:29pm UTC](https://forum.ansible.com/t/adding-insights-compliance-policy/45455 "2026-02-27T17:29:22Z")

</div>

Hi all, I have written a role that converts our current Alma Linux VMs to RHEL. As the last step I wanted to add CIS Compliance policy to the role. However, it seems to be failing. fatal: \[TESTHOST01\]: FAILED! =\> { …

---

## [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…

---

## [Cannot change a variable passed to a role from within a role - request for docs](https://forum.ansible.com/t/cannot-change-a-variable-passed-to-a-role-from-within-a-role-request-for-docs/45368)

<div class="topic-metadata">

**Author:** [@maxwax99](https://forum.ansible.com/u/maxwax99)\
**Replies:** 18\
**Last updated:** [February 23, 2026, 9:01am UTC](https://forum.ansible.com/t/cannot-change-a-variable-passed-to-a-role-from-within-a-role-request-for-docs/45368 "2026-02-23T09:01:26Z")

</div>

ansible \[core 2.16.3\] Today, from within a role, I tried to use set\_fact to change a variable that had been passed to the role from a playbook using vars:. Using -vv execution, the set\_fact task to change the variable …

---

## [How to merge several dicts](https://forum.ansible.com/t/how-to-merge-several-dicts/45378)

<div class="topic-metadata">

**Author:** [@kks](https://forum.ansible.com/u/kks)\
**Replies:** 0\
**Last updated:** [February 23, 2026, 8:59am UTC](https://forum.ansible.com/t/how-to-merge-several-dicts/45378 "2026-02-23T08:59:03Z")

</div>

This is continuation from discussion started with @utoddl in topic Cannot change a variable passed to a role from within a role - request for docs - #11 by utoddl The premise is following - there is a role that takes a …

---

## [\[Feedback\] Ansible Role ClamAV - additional protection on vm's](https://forum.ansible.com/t/feedback-ansible-role-clamav-additional-protection-on-vms/45032)

<div class="topic-metadata">

**Author:** [@mikolaj.jeziorny](https://forum.ansible.com/u/mikolaj.jeziorny)\
**Replies:** 0\
**Last updated:** [December 28, 2025, 9:29pm UTC](https://forum.ansible.com/t/feedback-ansible-role-clamav-additional-protection-on-vms/45032 "2025-12-28T21:29:07Z")

</div>

My new Ansible Role for install and configure CalmAV on the debian (and ubuntu). https://github.com/oxess/ansible-clamav The goal was create a role for simple implementation additional security for popular web applicat…

---

## [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…

---

## [Unmaintained role: ansible-community.ansible-vault](https://forum.ansible.com/t/unmaintained-role-ansible-community-ansible-vault/44776)

<div class="topic-metadata">

**Author:** [@zoug](https://forum.ansible.com/u/zoug)\
**Replies:** 2\
**Last updated:** [November 4, 2025, 11:16pm UTC](https://forum.ansible.com/t/unmaintained-role-ansible-community-ansible-vault/44776 "2025-11-04T23:16:24Z")

</div>

Hi there! Just wanted to bring to your attention that the role ansible-vault (for managing Hashicorp Vault machines, not related to the ansible-vault CLI - yes I know, terrible naming) seems unmaintained. The latest com…

---

## [How to loop over "include\_role" with a list of variable dictionaries?](https://forum.ansible.com/t/how-to-loop-over-include-role-with-a-list-of-variable-dictionaries/44625)

<div class="topic-metadata">

**Author:** [@Hoeze](https://forum.ansible.com/u/Hoeze)\
**Replies:** 5\
**Last updated:** [October 10, 2025, 8:43pm UTC](https://forum.ansible.com/t/how-to-loop-over-include-role-with-a-list-of-variable-dictionaries/44625 "2025-10-10T20:43:51Z")

</div>

Hi all, I am trying to loop over my “create\_user” role with a list of “users”: - name: Setup users include\_role: name: create\_user vars: "{{ user\_vars }}" loop: "{{ users\_to\_create }}" …

---

## [Documenting roles](https://forum.ansible.com/t/documenting-roles/42700)

<div class="topic-metadata">

**Author:** [@andy-maier](https://forum.ansible.com/u/andy-maier)\
**Replies:** 5\
**Last updated:** [August 9, 2025, 9:47am UTC](https://forum.ansible.com/t/documenting-roles/42700 "2025-08-09T09:47:12Z")

</div>

I am trying to document our Ansible roles and to generate .md or .rst files from them. The Ansible docs recommend documenting roles in meta/argument\_specs.yml, but they are silent about how an .md or .rst file can be ge…

---

## [Using facts in 'tasks\_from' with 'include\_role' will load the same task file for all hosts.](https://forum.ansible.com/t/using-facts-in-tasks-from-with-include-role-will-load-the-same-task-file-for-all-hosts/44204)

<div class="topic-metadata">

**Author:** [@carlos.e](https://forum.ansible.com/u/carlos.e)\
**Replies:** 5\
**Last updated:** [August 7, 2025, 3:22pm UTC](https://forum.ansible.com/t/using-facts-in-tasks-from-with-include-role-will-load-the-same-task-file-for-all-hosts/44204 "2025-08-07T15:22:57Z")

</div>

I was trying to use different entry points for a role depending on ansible\_facts\['system'\] var. The following example role has only 2 task files: Linux.yml: --- - name: Assert ansible.builtin.assert: that: …

---

## [Molecule: make tests FAIL](https://forum.ansible.com/t/molecule-make-tests-fail/43698)

<div class="topic-metadata">

**Author:** [@daks](https://forum.ansible.com/u/daks)\
**Replies:** 7\
**Last updated:** [July 12, 2025, 1:53pm UTC](https://forum.ansible.com/t/molecule-make-tests-fail/43698 "2025-07-12T13:53:07Z")

</div>

I have started creating some roles for my use and implemented some tests using Molecule which now uses Ansible as verifier. I’m not sure where I saw it but I have implemented tests using standard Ansible modules but wit…

---

## [How to validate the arguments for a nested dictionary](https://forum.ansible.com/t/how-to-validate-the-arguments-for-a-nested-dictionary/43284)

<div class="topic-metadata">

**Author:** [@markfaine](https://forum.ansible.com/u/markfaine)\
**Replies:** 5\
**Last updated:** [June 11, 2025, 3:29pm UTC](https://forum.ansible.com/t/how-to-validate-the-arguments-for-a-nested-dictionary/43284 "2025-06-11T15:29:58Z")

</div>

See: How to validate the arguments for a nested dictionary · Issue #2665 · ansible/ansible-documentation · GitHub SUMMARY I can’t find an example in the role argument validation documentation for how to document/vali…

---

## [Does host\_vars override role default role](https://forum.ansible.com/t/does-host-vars-override-role-default-role/41511)

<div class="topic-metadata">

**Author:** [@sparsick](https://forum.ansible.com/u/sparsick)\
**Replies:** 1\
**Last updated:** [April 4, 2025, 9:44am UTC](https://forum.ansible.com/t/does-host-vars-override-role-default-role/41511 "2025-04-04T09:44:22Z")

</div>

Like I understand the documentation about variable precedence, variable defined in host\_vars can override vars in roles default. I have the following playbook: --- - hosts: myhosts gather\_facts: false pre\_tasks: …

---

## [How to import host/group specific files into roles](https://forum.ansible.com/t/how-to-import-host-group-specific-files-into-roles/41375)

<div class="topic-metadata">

**Author:** [@Sameer\_Modak](https://forum.ansible.com/u/Sameer_Modak)\
**Replies:** 3\
**Last updated:** [April 1, 2025, 1:31pm UTC](https://forum.ansible.com/t/how-to-import-host-group-specific-files-into-roles/41375 "2025-04-01T13:31:59Z")

</div>

Hello Team, I am using role to install the kafka. I need help in using environment specific files from roles directory to the ansible code and eventually deployed onto the servers. For example we have some files which …

---

## [Mas installation ansible commands](https://forum.ansible.com/t/mas-installation-ansible-commands/41331)

<div class="topic-metadata">

**Author:** [@Poonam](https://forum.ansible.com/u/Poonam)\
**Replies:** 4\
**Last updated:** [March 27, 2025, 12:31pm UTC](https://forum.ansible.com/t/mas-installation-ansible-commands/41331 "2025-03-27T12:31:18Z")

</div>

Hi, I am trying to run playbook cp4d.yml but getting error - "ERROR! Unexpected Exception, this is probably a bug: No module named ‘mas’ " Not sure about what this means and how to proceed. Any ideas or thoughts?

---

## [Collections should have a default vars/arg spec method like roles](https://forum.ansible.com/t/collections-should-have-a-default-vars-arg-spec-method-like-roles/41191)

<div class="topic-metadata">

**Author:** [@Jeff\_Pullen](https://forum.ansible.com/u/Jeff_Pullen)\
**Replies:** 1\
**Last updated:** [March 24, 2025, 1:56pm UTC](https://forum.ansible.com/t/collections-should-have-a-default-vars-arg-spec-method-like-roles/41191 "2025-03-24T13:56:39Z")

</div>

Collections have no home for default vars The best practices for developing a collection insist on role specific variables (for good reason). This leads to many different variables across the collection with a shared val…

---

## [Gitlab Runner Client side - New module or able to reuse existing modules](https://forum.ansible.com/t/gitlab-runner-client-side-new-module-or-able-to-reuse-existing-modules/40976)

<div class="topic-metadata">

**Author:** [@guenther](https://forum.ansible.com/u/guenther)\
**Replies:** 6\
**Last updated:** [March 21, 2025, 11:46am UTC](https://forum.ansible.com/t/gitlab-runner-client-side-new-module-or-able-to-reuse-existing-modules/40976 "2025-03-21T11:46:22Z")

</div>

Hi, I’m co-maintainer of a gitlab-runner role, which is managing gitlab-runners on the client side. For server side, there is an existing community module. The only drawback of the gitlab role is, that it has to manage…

---

## [Why role cannot find template](https://forum.ansible.com/t/why-role-cannot-find-template/40379)

<div class="topic-metadata">

**Author:** [@rwagnergit](https://forum.ansible.com/u/rwagnergit)\
**Replies:** 6\
**Last updated:** [February 20, 2025, 8:56pm UTC](https://forum.ansible.com/t/why-role-cannot-find-template/40379 "2025-02-20T20:56:44Z")

</div>

Why would a role be able to find a template on one control machine but not another (both control machines are running out of the same git repo, so the playbooks/roles/templates/ansible.cfg are identical)? Directory stru…

---

## [It is not possible to mark a role as obsolete](https://forum.ansible.com/t/it-is-not-possible-to-mark-a-role-as-obsolete/40121)

<div class="topic-metadata">

**Author:** [@bodsch](https://forum.ansible.com/u/bodsch)\
**Replies:** 1\
**Last updated:** [February 8, 2025, 12:50pm UTC](https://forum.ansible.com/t/it-is-not-possible-to-mark-a-role-as-obsolete/40121 "2025-02-08T12:50:26Z")

</div>

Hi all, I have transferred some roles to a collection and no longer maintain the roles. I would now like to mark these roles as deprecated / non-maintained. Currently I could only delete them, but this would not be ba…

---

## [Cannot Publish Role, No Namespace Created](https://forum.ansible.com/t/cannot-publish-role-no-namespace-created/4851)

<div class="topic-metadata">

**Author:** [@3n3a](https://forum.ansible.com/u/3n3a)\
**Replies:** 1\
**Last updated:** [February 3, 2025, 6:14am UTC](https://forum.ansible.com/t/cannot-publish-role-no-namespace-created/4851 "2025-02-03T06:14:29Z")

</div>

Hello there. I logged into Ansible Galaxy NG for the first time today and wanted to publish a role, but no namespace was created for my username “3n3a”. What can i do?

---

## [How to use a different entry point in the \`roles\` part](https://forum.ansible.com/t/how-to-use-a-different-entry-point-in-the-roles-part/39659)

<div class="topic-metadata">

**Author:** [@elrond](https://forum.ansible.com/u/elrond)\
**Replies:** 6\
**Last updated:** [January 20, 2025, 3:36pm UTC](https://forum.ansible.com/t/how-to-use-a-different-entry-point-in-the-roles-part/39659 "2025-01-20T15:36:53Z")

</div>

In some of my roles I would like to use different entry points (not the usual main.yaml under tasks, but other.yaml). The relatively new Role argument validation (see the start of the specs) has primary support for entr…

---

## [Replacing value of list elements with info from another variable](https://forum.ansible.com/t/replacing-value-of-list-elements-with-info-from-another-variable/39256)

<div class="topic-metadata">

**Author:** [@JethCalark](https://forum.ansible.com/u/JethCalark)\
**Replies:** 3\
**Last updated:** [December 26, 2024, 9:30am UTC](https://forum.ansible.com/t/replacing-value-of-list-elements-with-info-from-another-variable/39256 "2024-12-26T09:30:58Z")

</div>

Working on a role for Authentik; as with any IdP, I’m dealing with users and groups. Authentik gives an idempotent API path to use for updating groups, and it uses JSON for the body of its API calls, which is convenient,…

---

## [Ansible role help for executing tags](https://forum.ansible.com/t/ansible-role-help-for-executing-tags/39268)

<div class="topic-metadata">

**Author:** [@USA\_Linux\_UAE](https://forum.ansible.com/u/USA_Linux_UAE)\
**Replies:** 1\
**Last updated:** [December 20, 2024, 2:42pm UTC](https://forum.ansible.com/t/ansible-role-help-for-executing-tags/39268 "2024-12-20T14:42:45Z")

</div>

Hello Newbie , trying to understand how a single task in role can be executed ? Is it possible in tasks/main.yml of roles to use ansible.tags and only execute ansible-playbook \<role.yml\> -i --tasks= \<task.name\> ?

---

## [Molecule: how to include local roles PATH to test playbook](https://forum.ansible.com/t/molecule-how-to-include-local-roles-path-to-test-playbook/10547)

<div class="topic-metadata">

**Author:** [@daks](https://forum.ansible.com/u/daks)\
**Replies:** 1\
**Last updated:** [October 28, 2024, 5:51pm UTC](https://forum.ansible.com/t/molecule-how-to-include-local-roles-path-to-test-playbook/10547 "2024-10-28T17:51:50Z")

</div>

Hello, I want to test a whole setup to provision my servers. It includes playbooks, tasks and also roles I have created and stored locally in a roles/ directory. In my ansible.cfg I added roles\_path=./roles and ansib…

---

## [Role names in collections should be able to begin with a underscore](https://forum.ansible.com/t/role-names-in-collections-should-be-able-to-begin-with-a-underscore/10454)

<div class="topic-metadata">

**Author:** [@gardar](https://forum.ansible.com/u/gardar)\
**Replies:** 11\
**Last updated:** [October 23, 2024, 6:55pm UTC](https://forum.ansible.com/t/role-names-in-collections-should-be-able-to-begin-with-a-underscore/10454 "2024-10-23T18:55:05Z")

</div>

According to the Collection structure chapter of the docs: Role names are now limited to contain only lowercase alphanumeric characters, plus \_ and start with an alpha character. However, I’ve observed that role name…

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