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 · 10 comments
Open

molecule init role is gone #574

iay opened this issue Jan 26, 2024 · 10 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

@eltribehou
Copy link

Just to add that i had decided to finally give molecule a test run, and yes it has been an exercice in frustration.
Nothing works, no doc whatsoever. Happy to find this post to at least know i'm not alone and that i should just give up.
Redhat has really gone bad.

@MaKaNu
Copy link

MaKaNu commented Sep 17, 2024

I just recently bought the book and was a bit frustrated after seeing that the molecule chapter is not really working these days. Not to blame @geerlingguy here, more the poor documentation of the molecule team at the moment. The documented getting started is not usable at all. As an example, if I follow this step by step and come to the point to change the converge.yml, the collection is not installed and so converge does not find the role. If I install the collection from local path, at least the role example works. But no luck with the playbook include.

I was happy to hear about molecule and the possibilities it brings to test against different environment, but the state of development and documentation seems to be a throwback.

@geerlingguy
Copy link
Owner

I would like to get to it, can't guarantee when unfortunately: #574 (comment)

Molecule has changed a lot in the past couple years, but seems to have settled down a little, so I think it would be a good time to retry writing up that chapter.

@NiftyMist
Copy link

Molecule is my secret weapon on the daily.

@MaKaNu
Copy link

MaKaNu commented Sep 18, 2024

My showstopper is executing roles on my docker instances. While direct tasks work, including roles does not. My open issue on molecule: ansible/molecule#4256 (comment)
Maybe this could help somehow.

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

6 participants