arensb / ansible-truenas

Ansible collection to manage TrueNAS
Apache License 2.0
34 stars 7 forks source link

users module should allow smb parameter when password_disabled is defined #12

Closed steven-ellis closed 4 months ago

steven-ellis commented 6 months ago

Reference

smb defaults to true which conflicts with password_disabled. Ideally using password_disabled should require the smb parameter so that so we have to explicitly disable the value.

steven-ellis commented 6 months ago

Error is

arensb commented 6 months ago

@steven-ellis Do you have a playbook that illustrates the problem you're seeing?

steven-ellis commented 6 months ago

Here is an example

   - name: Make sure  mythtv user exists
      arensb.truenas.user:
        name: mythtv
        uid: 1000
        groups: 'users,mythtv'
        password_disabled: yes
arensb commented 6 months ago

I haven't been able to reproduce this problem under TrueNAS Core. In my own testing, I was able to create users with password_disabled: yes, both with and without SMB enabled. Is this something that happens when a user is created? When an existing user is changed? Both?

And what flavor and version of TrueNAS are you using?

steven-ellis commented 6 months ago

TrueNAS Scale 23.10.2

This is happening when I try to create a new user. As a default a new user has smb defaulting to true which conflicts with password_disabled.

arensb commented 6 months ago

Sorry I've been neglecting these bugs. I've been dealing with family matters.

MozzieBytes commented 4 months ago

Sorry, I created a duplicate issue with #17

Have created a PR with a suggested fix.

This is an issue with TrueNAS scale and is still present with 24.4.0

MozzieBytes commented 4 months ago

Have linked PR to this issue now #17 has been closed as duplicate

arensb commented 4 months ago

I apologize for taking this long to get back to this project. I've just pushed out release 1.9.1, which should fix this problem. Please try it out.

MozzieBytes commented 4 months ago

@arensb Worked good for me!

I had some issues installing the updated collection via ansible-galaxy, but overwriting the installed user module with the updated file worked a treat.

(ansible-galaxy collection install arensb.truenas --force --pre installed 1.9.0 again :facepalm: )

MozzieBytes commented 4 months ago

Thank you for contributing a fix :smile:

arensb commented 4 months ago

@MozzieBytes Oh, sorry, yeah, I marked this as a tentative release on github, and haven't uploaded it to Ansible Galaxy. I was hoping to get some time to work on issues #13 and following in the coming days (we'll see if that works. I think the universe has other plans for me).

MozzieBytes commented 4 months ago

@MozzieBytes Oh, sorry, yeah, I marked this as a tentative release on github, and haven't uploaded it to Ansible Galaxy. I was hoping to get some time to work on issues #13 and following in the coming days (we'll see if that works. I think the universe has other plans for me).

Sorry about that! I'm still new to Ansible so am learning on the go with the nuances of how ansible-galaxy and collections work.

I'm happy to give the NFSv4 issue a go if that's at all helpful? Your description of how you see the issue being handled is enough that I could probably put together an implementation.