-
Notifications
You must be signed in to change notification settings - Fork 284
Introduce fromrepo support. #209
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
Introduce fromrepo support. #209
Conversation
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.
Well done, @noelmcloughlin !
I just have couple of things to address. Despite of that, your changes look solid.
postgres/codenamemap.yaml
Outdated
{% set pkg_dev = '' %} | ||
{% else %} | ||
{% set fromrepo = name %} | ||
{% set pkg_dev = 'postgresql-server-dev-all' %} |
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 think you want to expose pkg_dev
value in the rendered YAML dictionary below, since it would be just gone. Simply because upper level yaml loader does not inherit local variables, especially within macros scope.
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.
Thanks for reviewing @vutny I'll have a look at the comments now.
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 just realized pkg_dev
was already fixed in osfamilymap.yaml
by #200. I think we could remove pkg_dev
from codenamemap.yaml?
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.
Yeah, definitely.
pkg_repo: | ||
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main {{ repo.version }}' | ||
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main {{ version }}' |
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.
Good spot!
postgres/defaults.yaml
Outdated
@@ -57,6 +57,10 @@ postgres: | |||
|
|||
bake_image: False | |||
|
|||
fromrepo: | |||
pkg_repo: | |||
name: [] |
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 a little bit dangerous and I would recommend to avoid setting such defaults. I mean pkg_repo
dictionary.
- Empty name is meaningless (why the list by the way?) and still will produce sneaky errors if other maps would not set it right.
- If
use_upstream_repo
Pillar is set, theupstream
state would always try to provision some repo config, even if that is not applicable for some systems.
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.
Thanks for the assessment - the from_repo
will work for both upstream and distro postgres.
do you think this stanza is unnecessary in defaults.yaml? Thanks.
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.
Only the pkg_repo
is harmful, because it would interfere with repository config handling logic.
Keeping the fromrepo
is safe and necessary though.
These are resolved now. |
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.
Looks great! Thanks @noelmcloughlin
Thanks again @vutny |
This PR introduces
fromrepo
support (replaces #185 and resolves #133). Testing was done on Ubuntu/Centos/Fedora. Comments welcomed.