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

molecule init role is gone #574

Open
iay opened this issue Jan 26, 2024 · 5 comments
Open

molecule init role is gone #574

iay opened this issue Jan 26, 2024 · 5 comments
Labels

Comments

@iay
Copy link

iay commented Jan 26, 2024

Chapter 13, page 351, "Testing a role with Molecule":

molecule init role my.test

... no longer works. The molecule role init command was removed in Molecule 6.0 (I think):

Removed 'init role' command due to already being covered by ansible-galaxy

See ansible/molecule#3959

@iay
Copy link
Author

iay commented Jan 26, 2024

Seems as if the way to do this now is with ansible-glaxy role init foo followed by molecule init scenario inside that directory. I'm not sure about the use of my.test as a name for the role as in the book; I think for the directory to be test that needs to be the role name too.

@geerlingguy
Copy link
Owner

Definitely need to tweak some of the molecule bits — a lot changed in the past few months!

@iay
Copy link
Author

iay commented Jan 27, 2024

a lot changed in the past few months!

No joke. I don't know what it was like before, but 6.0.x seems to check the --driver-name option and then completely ignore it (see ansible/molecule#3773) so unless you know what you're doing (and I do not) then you can waste a lot of time before you figure out that the reason it's not generating a Docker container is that it has generated the default playbooks... and even if you then add the driver name to molecule.yml it still does nothing because the create and destroy playbooks it generated before override the ones from the driver.

You have your work cut out for you, I think, writing a description of this that will work with the usual minor differences between readers because at present Molecule seems to be super brittle. If there's anything I can do to help proof the new content, please let me know. I have (finally) got something that appears to be working, but I'm sure I am still missing a lot.

@pjgoodall
Copy link

pjgoodall commented Jan 29, 2024

I was just setting up to start using molecule for the first time as a beginner. I can’t find any version 6 introductory examples anywhere that mention virtualbox inventory, or pretty well any introductory version 6 in narrative form. I need to test against functional operating system instances, not docker. My playbooks are for configuring my developer workstations. I had been configuring Ubuntu 22.04 and Debian 12. It seems the molecule team wrote the documentation with themselves as the target audience. Missing pages in the docs site too.

@pjgoodall
Copy link

https://ansible.readthedocs.io/projects/molecule/en/latest/getting-started.html
IMG_1637

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

No branches or pull requests

3 participants