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

Implemented user authentication and parameter #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slueder
Copy link

@slueder slueder commented Jun 7, 2019

Hi Ondrej,

you have done a very good job creating this module.
I needed some enhancements in the area of initiator-based authentication and connection-related parameters.
Therefore I enhanced the code a bit, please find the result attached to this pull request.

Do you mind including this in your code so that these changes can be maintained in this module for the future ?

Best regards and keep up the good work,
Sven

@OndrejHome
Copy link
Owner

Hi Sven,
Thank you for using modules and for your contribution. I will have a better look at this over weekend and let you know if this can be merged right away or if any changes are needed. Will get back to you soon.
Ondrej

@OndrejHome OndrejHome self-assigned this Jun 7, 2019
@OndrejHome
Copy link
Owner

Hi Sven,

Thank you for your patience. Looking at this PR for targetcli-modules I can see 3 distinctive features in one commit:

  • ability to specify 'parameter' in targetclis_iscsi module to control for example limit on maximum concurrent connections
  • ability to specify 'auth' in targetcli_iscsi to enable WWN wide support for authentication
  • ability to specify 'userid' and 'password' in targetcli_iscsi_acl for given wwn
    (Note: for easier readibility it is good to separate above things at least into separate commits ;) (this is just for future) )

I have checked documentation for Linux SCSI Target and to my understanding the changes
will be able to handle following in terms of authentication:

  1. Is there some particular reason why to support only setting 'userid' and 'password' for ACLS but any options for TPG1?
    (for this I need answer to progress with PR)

  2. In terms of consistency I think it would make sense to set userid/password/mutual_userid/mutual_password for TPG1 and ACLS
    in same way - either providing just attribute 'auth' for both TPG1 and ACLS or creating 4 attributes for both TPG1 and ACLs. Now the code
    has both approaches implemented. Would it be possible for you to choose one of them and adjust the code for it?
    (I would subjectively prefer approach with 4 attributes as those can be later possibly validated or used to determine if any change needs to be done)

  3. I'm not sure when the cmd = "targetcli '/iscsi/%(wwn)s/tpg1 set attribute authentication=1'" % module.params should be set. Definitely as it is
    now when setting 'auth' on TPG1, but I would expect that this might make sense also when ACLs are created with credentials. Here I assume that whatever that
    is set on the TPG1 is kind of "default" while ACLs can override this default. But to tell iSCSI to use authentication only parameter authentication=1 at TPG1
    level should be used. Here I'm thinking about use case when you set 'auth' only on ACLS but not on TPG1, in such case I assume that on TPG you should make sure
    that authentication=1 is present, right? (this point is optional for PR acceptance)

  4. no_log=True should be used for password-like module arguments. For example on how how it looks you can check https://github.com/OndrejHome/ansible.pcs-modules-2/blob/ec5cb8e24ad0f40ec52343f2ede915840583db9c/library/pcs_auth.py#L85
    This would also allow to remove the commented out line with #no_log=True from PR for targetcli role. (this must be addressed to progress with PR)

  5. For module documentation could you please make a separate example so the previous example "without authentication" is preserved and add new example "with authentication". This is to make visible that modules can be used in both cases and how to specify it. 'parameters' option can be present in both cases. (this is needed for progressing the PR).

Sven, in case you have any questions to my above suggestions and questions feel free to ask. From what I see there are no serious issues, but only things that I would consider that needs a bit of improvements before merging this so this is maintainable for future. I will leave you soon also feedback on the PR for targetcli PR in the PR for targetcli. Here lets stay focused only on targetcli-modules part.

Ondrej

@OndrejHome OndrejHome self-requested a review June 9, 2019 06:27
Copy link
Owner

@OndrejHome OndrejHome left a comment

Choose a reason for hiding this comment

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

requested changes outlines in latest comment of PR.

@OndrejHome
Copy link
Owner

Hi @slueder this is just a reminder that I would need your input for these changes. In case that you would need more than 2 weeks for checking this out please let me know. If you have any questions feel free to ask anytime.

@slueder
Copy link
Author

slueder commented Jun 25, 2019 via email

@OndrejHome
Copy link
Owner

Hi Sven,
thank you for response and welcome back :)

@slueder
Copy link
Author

slueder commented Jul 9, 2019 via email

@OndrejHome
Copy link
Owner

Hi Sven,
Thank you for update. :)
Ondrej

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

Successfully merging this pull request may close these issues.

2 participants