-
Notifications
You must be signed in to change notification settings - Fork 200
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
Convert pipelines to obsah #1064
base: master
Are you sure you want to change the base?
Conversation
3676052
to
c725d59
Compare
I've verified this works locally. Obviously we'll need to modify our CI systems, at least to understand the new paths. Before I proceed with converting all pipelines, I want to know people actually like this. One question I have is whether it should be |
I would like this to handle more than just pipelines. So I'd be curious what your design for that would look like? Given the design of Obsah allows it run a playbook via command line it would be nice to be have it as the interface to run any of the playbooks herein. If wanting to start with just pipelines, I'd lean towards some sub-commands to help make it clearer:
|
I agree with that, which I was alluding to with my question is whether it should be I'll let @evgeni weigh in as well before I make any changes. |
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 tried to leave some comments about things that I thought might be a little unclear, but overall I think it looks really cool.
I'm unsure where to weigh in on the conversation above, but I agree with Eric that maybe making sub-commands would help. Though getting it out the door sounds good too. Either way this is looking great!
docs/testing.md
Outdated
```console | ||
$ ./bin/forklift upgrade --os centos7 --type katello --version nightly | ||
... lots of output | ||
$ ./bin/forklift upgrade --os centos7 --type katello --version nightly --state destroy |
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.
A little more explanation of why the second run is used would make it more understandable for someone starting to use it.
# TODO: up/rebuild/destroy | ||
pipeline_os: | ||
parameter: --os | ||
help: Operating system to install, like centos7, debian10 or ubuntu1804 |
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.
Are these the only operating systems that can be used? Can all the pipelines be run on any of the oses? Is it something more that the user would know when creating the pipeline?
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.
It maps to the pipeline_os
variable which maps back to the base boxes. Of course it doesn't magically work so we will need packages for the OS. So you can use centos6, it will fail during provisioning since there's no packages. We'll also add a centos8 box at some point.
pipeline_type: | ||
parameter: --type | ||
help: Type of pipeline, like foreman, katello or luna | ||
# TODO: choices: foreman/katello/luna |
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.
Same here as above, but it does look like you want to eventually have something here for that?
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.
Currently we only have a set of variables for those 3. That means we can enforce just the 3 options.
pipelines/upgrade/vars/base.yml
Outdated
@@ -1,3 +1,4 @@ | |||
forklift_directory: "{{ playbook_dir | dirname | dirname }}" |
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.
Why is dirname listed twice here?
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.
playbook_dir
is pipelines/upgrade
so the forklift root is pipelines/upgrade/../..
On the other hand, that will require us to merge the I think the easiest solution would be to call the binary |
Is this easier than naming it parser = argparse.ArgumentParser(prog='forklift')
subparsers = parser.add_subparsers(help='sub-command help')
obsah.add_subparser(subparsers, ApplicationConfig) |
So at the end we have a I think I'd still prefer to have the Oh, and this needs rebase please :) |
Currently obsah is rather tied to its own parser since the main function also does the processing. Right now I don't have the time to dive into how that would need to be written so I probably won't get to this until after FOSDEM and friends. |
cbc33fd
to
3dc62cf
Compare
Rebased to at least resolve the merge conflicts. Depends on theforeman/obsah#8. |
I did notice that this is quite slow because ansible calls the inventory, which calls |
Currently this doesn't work because the forklift role can't properly find the vagrant/boxes.d directory.