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

[FEATURE] add spacewalk api dynamic inventory script #58735

Closed
wants to merge 4 commits into from

Conversation

@jacobsalmela
Copy link

@jacobsalmela jacobsalmela commented Jul 4, 2019

Signed-off-by: Jacob Salmela me@jacobsalmela.com

SUMMARY

Introduces a dynamic inventory script that uses the Spacewalk API (v2.9). This is a different approach than the existing spacewalk.py dynamic inventory script, which uses spacewalk-reports command.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

spacewalk_api.py

ADDITIONAL INFORMATION

This is a dynamic inventory script that uses the Spacewalk API as a source. Spacewalk isn't really being developed anymore, but some people still use it heavily for patching, which makes it a decent source of truth for some.

In addition to getting hosts and groups, I have also included other things like dmidecode information, CPU stuff, and network information.

More to come to expand this script if the PR is merged.

Signed-off-by: Jacob Salmela <me@jacobsalmela.com>
@ansibot
Copy link
Contributor

@ansibot ansibot commented Jul 4, 2019

The test ansible-test sanity --test pylint [explain] failed with 1 error:

contrib/inventory/spacewalk_api.py:11:14: bad-whitespace Exactly one space required after assignment DOCUMENTATION ="""               ^

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

contrib/inventory/spacewalk_api.py:11:16: E225 missing whitespace around operator

click here for bot help

Signed-off-by: Jacob Salmela <me@jacobsalmela.com>
@imlight
Copy link

@imlight imlight commented Aug 30, 2019

@jacobsalmela :- This script is good , only problem is it is adding all the hosts to the all the groups listed in spacewalk.

I mean if host A is part of group X and host B is part of group Y and hosts A, B are part group Z , then with this inventory script it looks like below in AWX

Group X [ A,B]
Group Y [A,B]
Group Z[A,B]

@jacobsalmela
Copy link
Author

@jacobsalmela jacobsalmela commented Aug 30, 2019

OK I will take a look and send an update.

@imlight
Copy link

@imlight imlight commented Sep 3, 2019

@jacobsalmela I do not think the issue I am seeing has anything to do with the "-" character in the group name.

@jacobsalmela
Copy link
Author

@jacobsalmela jacobsalmela commented Sep 4, 2019

Thanks to some outside help, I should be able to fix the issue

Signed-off-by: Jacob Salmela <me@jacobsalmela.com>
@ansibot ansibot removed the stale_ci label Sep 5, 2019
@jacobsalmela
Copy link
Author

@jacobsalmela jacobsalmela commented Sep 5, 2019

OK @imlight I think the above should fix it

@ansibot
Copy link
Contributor

@ansibot ansibot commented Sep 5, 2019

The test ansible-test sanity --test future-import-boilerplate [explain] failed with 1 error:

contrib/inventory/spacewalk_api.py:0:0: missing: from __future__ import (absolute_import, division, print_function)

The test ansible-test sanity --test metaclass-boilerplate [explain] failed with 1 error:

contrib/inventory/spacewalk_api.py:0:0: missing: __metaclass__ = type

click here for bot help

Signed-off-by: Jacob Salmela <me@jacobsalmela.com>
@imlight
Copy link

@imlight imlight commented Sep 5, 2019

That looks to work .

Thanks

@jacobsalmela
Copy link
Author

@jacobsalmela jacobsalmela commented Sep 5, 2019

Cool. Now we'll just wait and see if the Ansible team thinks it's merge-worthy!

@guymatz
Copy link

@guymatz guymatz commented Aug 4, 2020

Hi!! Did this ever get merged? I could really use it!!

@sivel
Copy link
Member

@sivel sivel commented Aug 4, 2020

This PR is still open, and thus not merged. We are no longer accepting new inventory scripts to this repo. This PR would need to likely be re-submitted to https://github.com/ansible-collections/community.general or other appropriate collection repository.

@jacobsalmela
Copy link
Author

@jacobsalmela jacobsalmela commented Aug 5, 2020

OK, the next chance I get, I'll resubmit it there.

@Akasurde
Copy link
Member

@Akasurde Akasurde commented Aug 20, 2020

Hi @jacobsalmela, Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/community.general

If you have further questions please stop by IRC or the mailing list:

* IRC: #ansible on irc.freenode.net
* mailing list: https://groups.google.com/forum/#!forum/ansible-project

needs_info

@Akasurde Akasurde closed this Aug 20, 2020
@ansible ansible locked as resolved and limited conversation to collaborators Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants