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

New module: management of users in ManageIQ (monitoring/manageiq/manageiq_user) #25106

Closed

Conversation

dkorn
Copy link

@dkorn dkorn commented May 28, 2017

SUMMARY

ManageIQ is an open source management platform for Hybrid IT.

This change is adding:

  • manageiq_user module, responsible for user management in ManageIQ
  • manageiq utils
  • manageiq doc_fragment

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
  • New Module Pull Request
COMPONENT NAME

manageiq_user.py (module)
manageiq.py (module utils and doc_fragement)

ANSIBLE VERSION
ansible 2.3.0.0

@dkorn dkorn force-pushed the manageiq_utild_docs_and_user_module branch from 14586ea to 5465cb3 Compare May 28, 2017 07:07
@ansibot
Copy link
Contributor

ansibot commented May 28, 2017

@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:

  • issue type

Please set the description of this pullrequest with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/PULL_REQUEST_TEMPLATE.md

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented May 28, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 c:module_utils/ docs_pull_request module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. labels May 28, 2017
@dkorn
Copy link
Author

dkorn commented May 28, 2017

@thaumos please review
cc @cben @simon3z @enoodle @zgalor

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_plugin This PR includes a new plugin. and removed needs_info This issue requires further information. Please answer any outstanding questions. needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly. labels May 28, 2017
@dkorn dkorn force-pushed the manageiq_utild_docs_and_user_module branch from 5465cb3 to 1b0823c Compare May 28, 2017 07:31
description:
- manageiq password
default: MIQ_PASSWORD env var if set. otherwise, it is required to pass it
miq_verify_ssl:
Copy link
Contributor

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.

Copy link
Author

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
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

Done, thanks!

#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Done, thanks!

@thaumos
Copy link
Contributor

thaumos commented May 30, 2017

@dkorn, please provide Github usernames of who you would like listed as maintainers of the manageiq namespace.

@gundalow
Copy link
Contributor

@gundalow gundalow added the ci_verified Changes made in this PR are causing tests to fail. label May 31, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label May 31, 2017
@dkorn dkorn force-pushed the manageiq_utild_docs_and_user_module branch from 1b0823c to abcf80c Compare June 4, 2017 13:36
@dkorn
Copy link
Author

dkorn commented Jun 4, 2017

@dkorn, please provide Github usernames of who you would like listed as maintainers of the manageiq namespace.

Maintainers: @cben @dkorn @simon3z

@simon3z - anyone else?

@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Jun 4, 2017
@dkorn dkorn force-pushed the manageiq_utild_docs_and_user_module branch from abcf80c to d4326b5 Compare June 5, 2017 09:02
@ansibot
Copy link
Contributor

ansibot commented Jun 5, 2017

The test ansible-test sanity --test validate-modules failed with the following error:

lib/ansible/modules/monitoring/manageiq/manageiq_user.py:0:0: E312 No RETURN provided

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Jun 5, 2017
@dkorn
Copy link
Author

dkorn commented Jun 5, 2017

The test ansible-test sanity --test validate-modules failed with the following error:

lib/ansible/modules/monitoring/manageiq/manageiq_user.py:0:0: E312 No RETURN provided

@gundalow @thaumos the only return values in the manageiq_user module are msg and changed, which are common to all modules (https://docs.ansible.com/ansible/common_return_values.html#common-return-values).

do you want me to leave the RETURN documentation empty or mention them?

@dkorn dkorn force-pushed the manageiq_utild_docs_and_user_module branch from d4326b5 to da3a0b6 Compare June 5, 2017 12:58
@ansibot ansibot added the community_review In order to be merged, this PR must follow the community review workflow. label Jun 10, 2017
@dkorn
Copy link
Author

dkorn commented Jun 11, 2017

@thaumos passed CI, can you approve/merge?

@thaumos thaumos self-requested a review June 13, 2017 19:50
Copy link
Contributor

@thaumos thaumos left a comment

Choose a reason for hiding this comment

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

lgtm

@thaumos
Copy link
Contributor

thaumos commented Jun 13, 2017

@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.

@simon3z
Copy link

simon3z commented Jun 13, 2017

@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.

cc @cben

@ryansb
Copy link
Contributor

ryansb commented Jun 15, 2017

bot_status



import os
from manageiq_client.api import ManageIQClient
Copy link
Contributor

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'
Copy link
Contributor

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
Copy link
Contributor

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/)'
Copy link
Contributor

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
Copy link
Contributor

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

@ansibot
Copy link
Contributor

ansibot commented Jun 15, 2017

waiting_on: dkorn
module: manageiq_user
changes_requested_by: thaumos
needs_info: False
needs_revision: True
needs_rebase: False
merge_commits: []
mergeable_state: clean
shippable_status: success
maintainer_shipits: 0
community_shipits: 0
ansible_shipits: 1
shipit_actors: thaumos

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 15, 2017
state:
description:
- The state of the user
- On present, it will create the user if it does not exist or update the
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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,
Copy link
Contributor

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
Copy link
Contributor

cben commented Jun 19, 2017

cc @abraverm who's working on another ManageIQ module.

  • @abraverm you're adding in modules/remote_management/manageiq/, this PR adds in modules/monitoring/manageiq/ — let's converge on one.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 19, 2017
@simon3z
Copy link

simon3z commented Jun 19, 2017

@cben can you bring forward this? Pick up and address the comments?

@cben
Copy link
Contributor

cben commented Jun 19, 2017

=> A couple manageiq devs say Remote Management sounds more appropriate than Monitoring.
@thaumos @gundalow @pilou- any opinion on that?

@gundalow
Copy link
Contributor

@cben Good idea asking others.
I've happy with "Remote management"

@thaumos
Copy link
Contributor

thaumos commented Jun 19, 2017

@cben, I would agree with Remote Management... I didn't like monitoring to begin with, personally. I just didn't want to say anything.

@simon3z
Copy link

simon3z commented Jun 19, 2017

👎 -1 for Monitoring
(Remote Management could be OK)

@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@gundalow
Copy link
Contributor

Closing as this has moved to #26641

@gundalow gundalow closed this Jul 12, 2017
@ansibot ansibot added docs This issue/PR relates to or includes documentation. and removed docs_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 c:module_utils/ docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_module This PR includes a new module. new_plugin This PR includes a new plugin. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants