Closed deogracia closed 2 years ago
@deogracia
It is by design.
The underscore, '_', in role name is mentioned in creating_role role-names as below.
Role names are limited to lowercase word characters (i.e., a-z, 0-9) and ‘_’. No special characters are allowed, including ‘.’, ‘-‘, and space. During import, any ‘.’ and ‘-‘ characters contained in the repository name or rolename will be replaced with ‘’.
Generally, a namespace is required to init a role by molecule. Like acme
in acme.myrole
.
You can change acme
to your Github username or an allowed name following namespace-limitations
The first time you log into Galaxy using your GitHub credentials a namespace is created for your GitHub username automatically. For name limiations view Namespace Limitations. To request additional namespaces view Requesting Additional Namespaces.
If it can address your issue, could you close it?
Thanks for pointing me out this parts, @zhan9san
First, my role won't be on ansible Galaxy. I don't think the namespace parts is really important. What I really don't understand is if molecule use ansible-galaxy to create role, why, given the same input molecule fails. On Creating Role, there's no mention that namespace is mandatory. But in molecule it is..
And for me, who only produce standalone role (at least for now) , it's annoying to generate new role with ansible-galaxy + using manual steps to do the same job as molecule init role
.
Am I completely off tracks ansible/molecule normal way?
Hi @deogracia
It is recommended to use FQCN for builtin actions, even though it is not uploaded to Ansible Galaxy.
If there is no 'namespace' defined in rolename's prefix, it may be included by my_new_role
instead of acme.my_new_role
, and ansible-lint
is not happy with that.
Let me know if you have any concerns.
Reference: ansible-lint fqcn builts
Thanks @zhan9san !I'm sorry I didn't answer before. I use now FQCN first.
It also fails if you have more than one namespace prefixes, mine is nats.default.my_new_role
This should work as far as I can tell.
Issue Type
Molecule and Ansible details
Molecule installation method:
Ansible installation method:
Detail any linters or test runners used:
Desired Behavior
molecule init role role_A
should create role whenansible-galaxy init role_A
Actual Behaviour
Molecule debug's option doesn't help