-
Notifications
You must be signed in to change notification settings - Fork 614
convert ERB templates to EPP #1399
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 ERB templates to EPP #1399
Conversation
postgresql::params is a classBreaking changes to this file WILL impact these 2 modules (exact match):Breaking changes to this file MAY impact these 3 modules (near match):postgresql::server is a classBreaking changes to this file WILL impact these 41 modules (exact match):
Breaking changes to this file MAY impact these 17 modules (near match):postgresql::server::instance::config is a typethat may have no external impact to Forge modules. postgresql::server::instance::systemd is a typethat may have no external impact to Forge modules. postgresql::server::pg_hba_rule is a typeBreaking changes to this file WILL impact these 14 modules (exact match):Breaking changes to this file MAY impact these 4 modules (near match):postgresql::server::pg_ident_rule is a typeBreaking changes to this file WILL impact these 1 modules (exact match):Breaking changes to this file MAY impact these 1 modules (near match):postgresql::server::recovery is a typethat may have no external impact to Forge modules. This module is declared in 70 of 580 indexed public
|
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 like this, but wonder if it would make sense to add data types to the EPP files themselves. My biggest issue with ERB templates is that it's very easy to forget some (required) value and it silently proceeds. Data types are awesome to prevent that.
@ekohl good point!
I will add these. |
Yes exactly. |
5fc3fd8
to
938e062
Compare
Boolean $delete_before_dump, | ||
String[1] $dir, | ||
Enum['plain','custom','directory','tar'] $format, | ||
Array $optional_args, |
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.
Is this Array[String[1]]
or do we also expect Integer
in there?
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 took over the current types in #1397 or these which are currently in the module. If there are adjustments over all, I would do these later.
Optional[String[1]] $post_script, | ||
Optional[String[1]] $pre_script, |
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 calls flatten($pre_script)
and flatten($post_script)
which implies an Array
is supported/expected. In addition to that, it may even be nested (given flatten is called). If you're doing a breaking change, I'd suggest Array[String[1]]
and remove the flatten()
call.
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.
see comment above
@@ -1,3 +1,20 @@ | |||
<%- | | |||
Boolean $compress, | |||
Array $databases, |
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.
You could use Array[String[1]] $databases = []
and simplify the code. Right now it still deals with undef
and it not being an Array
.
Optional[Boolean] $recovery_target_inclusive, | ||
Optional[String[1]] $recovery_target, | ||
Optional[String[1]] $recovery_target_timeline, | ||
Optional[Boolean] $pause_at_recovery_target, |
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 always find Optional[Boolean]
interesting because it's usually equal to Boolean $var = false
. Not always, since you can have a tri-state where undefined is special cased, but not here. So I'd suggest to simplify it here.
* add puppet/systemd module * remove systemd daemon reload and raise minimal puppet version to 6.1 * remove old "drop-in file" removal, was in place 3 years now * move systemd drop-in file handling to seperate define * Implement recent feedback * define is now private * rename parameter in define call * fix unit tests * fix rubocop complains * fix path, set default fact * fix systemd drop in file, adding template parameters to systemd define * added reason for drop in file in a comment
938e062
to
04d61cb
Compare
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 this is a good way forward an can be merged. Yes the types could be a bit stricter in some places, but the PR is already huge. I think this is good to go, then #1397 is a good enhancement. We can always improve the datatypes further.
rebase against #1396 after merge