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

Add option for tower inventory to give general metadata #52747

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

AlanCoding
Copy link
Member

SUMMARY

This adds an option which, if enabled, will return additional information about the remote tower server which the plugin is returning mirroring content from.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lib/ansible/plugins/inventory/tower.py

Ansible Tower inventory plugin

ADDITIONAL INFORMATION

We need to know license type to tell apart AWX vs. Ansible Tower, and I also thought that version and ansible_version would be of general utility.

Ping @matburt @wenottingham

Example of using this parameter:


ansible-inventory -i private/tower/tower.yml --list --export
{
    "_meta": {
        "hostvars": {
            "HostMachinePossiblenew": {
                "ansible_connection": "local", 
                "ansible_host": "127.0.0.1", 
                "remote_tower_enabled": "true", 
                "remote_tower_id": 588
            }
        }
    }, 
    "all": {
        "children": [
            "ungrouped"
        ], 
        "vars": {
            "tower_metadata": {
                "ansible_version": "2.7.5", 
                "license_type": "open", 
                "version": "2.0.1-1068-g09684e2c41"
            }
        }
    }, 
    "ungrouped": {
        "hosts": [
            "HostMachinePossiblenew"
        ]
    }
}

The id and enabled variables are already kind of "metadata", but are host specific.

I did wonder if it might be better to create a new group, and put the variables in there (that way, if you are using multiple inventory sources, they don't get messed up). Either way, it doesn't matter to me. This is my initial pass because it seems like the path of least clutter.

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. 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. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 21, 2019
@AlanCoding
Copy link
Member Author

Requesting review @ryanpetrello @rooftopcellist

@ryanpetrello
Copy link
Contributor

shipit

@matburt
Copy link
Member

matburt commented Feb 28, 2019

shipit

1 similar comment
@rooftopcellist
Copy link
Member

shipit

@AlanCoding
Copy link
Member Author

bot_status

@ansibot
Copy link
Contributor

ansibot commented Mar 1, 2019

Components

lib/ansible/plugins/inventory/tower.py
support: community
maintainers:

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 0
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainer or core team member): []
shipit_actors_other: ryanpetrello matburt rooftopcellist
automerge: automerge shipit test failed

click here for bot help

@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 Mar 1, 2019
@ansibot ansibot removed 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 Mar 1, 2019
@AlanCoding
Copy link
Member Author

automerge: automerge shipit test failed

What does that mean? Where can I find the output from this test?

@gundalow
Copy link
Contributor

gundalow commented Mar 5, 2019

Looks like commit was after the last s h i p i t which resets the counter to zero

shipit

@kdelee
Copy link
Member

kdelee commented Mar 6, 2019

shipit

1 similar comment
@rooftopcellist
Copy link
Member

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 6, 2019
@gundalow gundalow merged commit e21ca4a into ansible:devel Mar 6, 2019
@gundalow
Copy link
Contributor

gundalow commented Mar 6, 2019

That did it thanks, merged into devel for release in Ansible 2.8.

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Mar 6, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 feature This issue/PR relates to a feature request. shipit This PR is ready to be merged by Core 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

8 participants