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
New module: management of users in ManageIQ (monitoring/manageiq/manageiq_user) #25106
Conversation
14586ea
to
5465cb3
Compare
@dkorn Greetings! Thanks for taking the time to open this pullrequest. In order for the community to handle your pullrequest effectively, we need a bit more information. Here are the items we could not find in your description:
Please set the description of this pullrequest with this template: |
5465cb3
to
1b0823c
Compare
description: | ||
- manageiq password | ||
default: MIQ_PASSWORD env var if set. otherwise, it is required to pass it | ||
miq_verify_ssl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with other modules please use:
validate_certs:
description:
- If C(no), SSL certificates will not be validated. This should only be used
on personally controlled sites using self-signed certificates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
|
||
module: manageiq_user | ||
|
||
short_description: management of users in ManageIQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All description
should start with a capital letter, and end with a fullstop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
lib/ansible/module_utils/manageiq.py
Outdated
# | ||
# This file is part of Ansible | ||
# | ||
# Ansible is free software: you can redistribute it and/or modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module_utils files should be licences under BSD
https://docs.ansible.com/ansible/dev_guide/developing_modules_in_groups.html#before-you-start-coding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
@dkorn, please provide Github usernames of who you would like listed as maintainers of the manageiq namespace. |
Number of CI issues: https://app.shippable.com/github/ansible/ansible/runs/23524/1/tests |
1b0823c
to
abcf80c
Compare
abcf80c
to
d4326b5
Compare
The test
|
@gundalow @thaumos the only return values in the do you want me to leave the |
d4326b5
to
da3a0b6
Compare
@thaumos passed CI, can you approve/merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@dkorn, could you attend the Public Core meeting on 6/15 @ 1500 UTC and raise the PR there? Make sure to add this PR as a comment in ansible/community issue number 162. |
bot_status |
|
||
|
||
import os | ||
from manageiq_client.api import ManageIQClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle import error
fullname: 'Daniel Korn' | ||
password: '******' | ||
group: 'EvmGroup-user' | ||
email: 'dkorn@redhat.com' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options: | ||
miq_url: | ||
description: | ||
- The ManageIQ environment url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full sentences + full stops
Capitals for acronyms
The ManageIQ environment URL.
default: null | ||
|
||
requirements: | ||
- 'manageiq-client (source: https://github.com/ManageIQ/manageiq-api-client-python/)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this a clickable link please do
'manageiq-client U(https://github.com/ManageIQ/manageiq-api-client-python/)'
default: MIQ_URL env var if set. otherwise, it is required to pass it | ||
miq_username: | ||
description: | ||
- ManageIQ username |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManageIQ username. C(MIQ_USERNAME) env var if set. otherwise, it is required to pass it.
and delete the default:
line.
This applies to the remainder of this file
waiting_on: dkorn |
state: | ||
description: | ||
- The state of the user | ||
- On present, it will create the user if it does not exist or update the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use formatting options: for example C(present)
instead of present
.
""" | ||
|
||
def __init__(self, manageiq): | ||
self.changed = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
doesn't need to be an attribute.
Whether or not a change took place and a message describing the | ||
operation executed. | ||
""" | ||
group = self.manageiq.find_collection_resource_by('groups', description=group) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group
parameter is flagged as not required
in argument_spec
, what returns the ManageIQ API when group
is None ?
changed=self.changed, | ||
msg="User {userid} already exist, no need for updates".format(userid=userid)) | ||
url = '{api_url}/users/{user_id}'.format(api_url=self.manageiq.api_url, user_id=user.id) | ||
resource = {'userid': userid, 'name': username, 'password': password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it the resource
dictionary should contain all these keys or only the ones with value which isn't None
? I mean, when password
parameter is set andemail
parameter is not set, will the API unset the email
or keep this attribute unmodified ?
@cben can you bring forward this? Pick up and address the comments? |
@cben Good idea asking others. |
@cben, I would agree with Remote Management... I didn't like monitoring to begin with, personally. I just didn't want to say anything. |
👎 -1 for Monitoring |
Closing as this has moved to #26641 |
SUMMARY
ManageIQ is an open source management platform for Hybrid IT.
This change is adding:
All the modules, including docs, tests and usage examples can be found here
Currently, the only requirement for the modules is manageiq-api-client-python
ISSUE TYPE
COMPONENT NAME
manageiq_user.py (module)
manageiq.py (module utils and doc_fragement)
ANSIBLE VERSION