Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hint about current directory for "initialization" #2842

Merged
merged 1 commit into from Sep 22, 2020

Conversation

wouterj
Copy link
Contributor

@wouterj wouterj commented Sep 21, 2020

SUMMARY

It took me quite some time and the help of this #1133 issue (where the author also needed quite some time) to figure out that I was running this command from the wrong directory (namely the parent of the role's directory).

I think it would help if the docs were a bit more clear about this :)

ISSUE TYPE
  • Docs Pull Request

+label: docsite_pr

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is necessary. I think it is generally known that the role name is the path to the role's directory structure. For example, molecule init scenario -r ~/ansible/roles/my-role-name is also an acceptable path. Let's get some more comments on this first though.

@ghost ghost requested a review from ssbarnea September 21, 2020 16:16
@wouterj
Copy link
Contributor Author

wouterj commented Sep 21, 2020

Hmm, I'm quite new to Ansible and it's community, so I'm a weak on "common" or best practices. If this is common knowledge, feel free to close.

To illustrate my situation:
In our directory structure, we have a mono repo with some roles saved in roles/..., similar to this: https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout

I've used molecule to set-up new roles using molecule init role my-new-role from inside roles/. So when I wanted to add molecule to an existing role, I was trying the same and I tried to execute molecule init scenario -r my-existing-role from within roles/, which caused the error "Please choose the proper role name.". As there weren't many details of "proper role names", it took a while before I discovered I had to execute this command from within the role directory (so within roles/my-existing-role)

@ssbarnea ssbarnea merged commit a94e407 into ansible:master Sep 22, 2020
@ssbarnea ssbarnea added the docs label Sep 22, 2020
@wouterj wouterj deleted the patch-1 branch September 22, 2020 08:33
@MarkusTeufelberger
Copy link
Contributor

As an aside, role names should not contain the - character, so it might be better to give my_existing_role as an example. Ansible-lint will complain about the role name otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants