-
Notifications
You must be signed in to change notification settings - Fork 17
(FM-7230) Specify defaults for multiple devices when using Hiera or Classifier #24
(FM-7230) Specify defaults for multiple devices when using Hiera or Classifier #24
Conversation
This looks great. I did uncover one thing while testing - once we add devices via hiera there doesn't appear to be an easy way to remove all nodes. There is some implicit purge that happens in the module when you manage at least one device, but not if you remove them all. I thought This affects both this PR and the current version of the module, so I wouldn't say we need to gate this PR on a fix, but I leave that to the expert @tkishel to decide :) |
Uff da :) I have thought about some options to address this: I’ll followup
on Monday ...
…On Mon, Jul 30, 2018 at 9:31 AM Rick Sherman ***@***.***> wrote:
This looks great. I did uncover one thing while testing - once we add
devices via hiera there doesn't appear to be an easy way to remove all
nodes. There is some implicit purge that happens in the module when you
manage at least one device, but not if you remove them all.
I thought device_manager::devices: {} would do the trick but no dice.
This affects both this PR and the current version of the module, so I
wouldn't say we need to gate this PR on a fix, but I leave that to the
expert @tkishel <https://github.com/tkishel> to decide :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABid_04shDQqVrYRCFtJy6_eO2X0hieDks5uLzT8gaJpZM4VkXOR>
.
|
49d5e11
to
d1f6c5b
Compare
The implicit purge is a result of includes of Best practice is to |
d1f6c5b
to
b6e7e6e
Compare
@shermdog It occurred to me that, based upon key name, users might misinterpret the Let me know if you agree, and if you would like these commits squashed, and I will do so. |
@tkishel that took me a bit to suss out :) You raise a good point. Would it actually make sense to add the defaults hash lookup to the defined type so users could take advantage of those defaults even when explicitly using the defined type? (Assuming that's actually possible). |
A quick test shows that automatic parameter lookup does not support defined types, but I'll double-check my results, because I thought it did (at least in Puppet 5+). If not, I don't know if converting the
Implementing type-level (f5, cisco_ios, ...) defaults rules out using a standard Hiera deeper merge. Adding or moving the defaults hash lookup to the |
@tkishel your opinion is 💯 authoritative - Go ahead and change to |
Well, I don't know about being authoritative. Research / Testing: Defined types do not support automatic parameter lookup. But ... Adding lookups to the So ... I've submitted PR #25 as an alternative: it implements global and device-type defaults |
72d9c96
to
2c35290
Compare
@shermdog I've squashed in any case, to make it easier to compare PRs. If you prefer this PR, I can change to If you prefer PR #25, I can close this PR. If you prefer just devices.pp from PR # 25 (which replaces |
I’ve reviewed this with Reid and I’ll make one more push to consolidate these PRs in the morning .... |
a217a26
to
9032f98
Compare
Reid suggested modeling the device data structures after the Inventory file in Bolt, but I could not translate that cleanly without increasing the verbosity. I did incorporate some of his other suggestions. Closed PR # 25, changed |
…fier This commit implements global and device-type levels of default values. These defaults are used by `device_manager::devices`.
9032f98
to
e115dac
Compare
This commit implements global and device-type levels of default values.
These defaults are used with
device_manager::devices
.This commit also updates the documentation and examples for clarity,
and updates the same examples in the spec tests for consistency.