-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Remove vendored inventory scripts #6911
Remove vendored inventory scripts #6911
Conversation
I've pondered on the subject, and I see the fastest way to getting this in to be just writing a migration for cloudforms. I would target the SCM inventory, url, and branch: https://github.com/ansible/ansible/blob/stable-2.9/contrib/inventory/cloudforms.py because I'm not deleting these just to re-vendor them in a migration. Ping @wenottingham as simply an FYI. I can't see that migration going any other way, it's not going to be super technically challenging to add it, it's just a little more I'm planning on here. It's going to involve some nastiness with creating a new project just for this purpose, but that's fine by me. |
0d0548a
to
e5fdbac
Compare
Is that better or worse than migrating it into the database as a deprecated script? |
But then I would have to put a copy of the deprecated script into the migration folder, and I don't want to do that, because that's still vendoring it. I'll have to mess around with the project creation, naming, initial role creation, figuring out the organization for it, and so on. We would still have some of those problems doing a "custom script", and on-balance I would much prefer the SCM inventory. Also, custom scripts are deprecated... |
e5fdbac
to
491c26c
Compare
6c0de58
to
667093b
Compare
667093b
to
867e91d
Compare
Build succeeded.
|
I'm finished poking at this, testing looked okay last I checked but was conflated with other unrelated issues in devel. |
867e91d
to
ed1a24f
Compare
Build succeeded.
|
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.
🙏
ed1a24f
to
f238e1a
Compare
Build failed.
|
recheck |
for inv_src in InventorySource.objects.filter(source=source).iterator(): | ||
inv_src.source = 'scm' | ||
inv_src.source_project = project | ||
inv_src.source_path = 'contrib/inventory/{}.py'.format(source) |
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.
This is sneaky as hell, and I highly approve of it 😄
@@ -11,10 +11,6 @@ | |||
import os.path | |||
from urllib.parse import urljoin | |||
import yaml | |||
import configparser |
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 cannot express with words the amount of joy this specific file diff brings me.
Build failed.
|
organization=inventory.organization, | ||
source='ec2' | ||
) | ||
invsrc.create_scm_script_substitute(apps, 'ec2') |
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.
👍
f238e1a
to
e784a7c
Compare
Build succeeded.
|
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.
Upgrade test went smooth
Build succeeded (gate pipeline).
|
@AlanCoding can you open a PR with a succinct description of this (and the new requirement of 2.9+) into the I think this PR merging means we're mostly done with this work item, but I think there's also going to be some clear documentation that needs to come out of this to call this truly "finished". |
Let's move that discussion over to #7379 |
updated version of #6088
For WIP major remaining work item is figuring our a solution for existing cloudforms sources. It's possible to drop in a custom script as a replacement... but that takes work.