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
Can not Export inventory hosts #7447
Comments
@chrismeyersfsu |
Hey @takezyou, We'd love a PR 😄 ! I'll leave @chrismeyersfsu' name on this since he's ultimately one of the people who would probably review such a PR. |
Thank you!!😊 |
@takezyou I'm also able to answer questions, as I did the original work on this feature. |
I could currently call in related. |
@takezyou got your code somewhere we can see it? Off the top of my head this related endpoint is a create/attach/detach one, so based on the way I did most of the other related endpoints like it, it would rely on hosts and groups being top-level exportable objects. You would need, I think, to make sure the page model for these have a natural key defined, and that they are added to the top-level exportable objects list and the page model names are added to the exportable relations list. I'm guessing you did natural key and exportable relations parts of this based on the data structure you pasted above, but you would need to actually export and import the underlying objects in order for these natural keys to have something for the algorithm to find when doing the attachments. I'm not sure how much it makes sense to actually do it that way, though. It could be that these objects should be treated more like workflow nodes, created in-place and never shared, in which case they should primarily go in the exportable dependent objects list. Also, I believe that there are other questions that would have to be answered about what to do with hosts and groups from inventory sources. |
@jbradberry |
If the issue is that when you export only an inventory it does not export related hosts, we should probably just document that. |
Is this a regression from the old unofficial Tower CLI tool? If that tooling supported this, then I think this is a regression, and we should support it too. |
Looks to me like the old tower-cli receive --inventory "Demo Inventory"
[
{
"asset_type": "inventory",
"name": "Demo Inventory",
"organization": "Default",
"asset_relation": {
"host": [
{
"name": "localhost",
"variables": "ansible_connection: local\nansible_python_interpreter: '{{ ansible_playbook_python }}'"
}
],
"group": [],
"inventory_source": [],
"roles": [
{
"name": "Admin",
"user": [],
"team": []
},
{
"name": "Update",
"user": [],
"team": []
},
{
"name": "Ad Hoc",
"user": [],
"team": []
},
{
"name": "Use",
"user": [],
"team": []
},
{
"name": "Read",
"user": [],
"team": []
}
]
}
}
] So I'd classify this current issue report as a bug. cc @elyezer |
Hey @one-t can you provide some details on what got this kicked back to |
Hey! Sorry, meant to comment on this- at this point we'd like to test this post-merge. Once it's been merged just put it back in needs_test and we can verify. |
Okay @one-t, it's merged. |
Hey verified that:
Inventory with host and group:
|
@tiagodread How did you test the import? Tried pasting into git and it says "[WARNING]: Skipping 'inventory' as this is not a valid group definition" and nothing imported. |
ISSUE TYPE
SUMMARY
Inventory does not include the host when doing an awx export
ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: