[10:03:01] do you know off hand if we have something in puppet.git to apply a patch to a file? instead of just deploying a file [10:03:08] I'm just trying not to write such thing myself [10:09:47] what do you want to do? apply a patch to a file which is otherwise shipped from a deb package? [10:10:01] moritzm: exactly [10:10:28] I will just use an exec { running the patch command I think [10:11:17] we're doing this in Icinga, let me find it [10:11:45] modules/icinga/manifests/init.pp [10:13:29] * arturo nods [10:13:33] it's not really clean, it breaks some of the assumptions of the dpkg package state and mid term I want to make this impossible (as the same could also be applied maliciously) [10:13:58] but that's nothing which will happen in the near future, other things have priority [10:14:08] ack [10:14:20] so feel free to apply this for whatever Openstack migration you're handling :-) [10:34:58] <_joe_> arturo: augeas [10:35:27] <_joe_> that's how you programmatically patch files [10:35:41] but that won't work for source code files? [10:36:02] <_joe_> oh sorry [10:36:27] <_joe_> so you're patching the file? just copy the patched file in puppet and install it with file { ... [10:36:46] <_joe_> it's more explicity and allows to properly manage it [10:37:13] <_joe_> but yeah the clean way to do it is to rebuild the deb and use quilt to apply the patch [10:37:26] that's how we have been doing it for years (deploying the already patched file) [10:37:33] but is a relatively long file, with a very simple patch [10:37:39] <_joe_> don't use an exec please :) [10:37:55] and tracking the patched file itself is complex [10:38:02] I would rather handle the .patch file [10:38:17] <_joe_> then do as you whish [10:38:39] the ultimate goal is to get rid of *any* patching. This is my effort to reduce our custom hack, the first iteration [10:39:09] <_joe_> again, the right way to do it is I think to add your patches to the deb packages [10:39:22] <_joe_> but I might not see some complications [10:39:47] <_joe_> I might suggest, if you plan to reuse this technique, to make this a define with some spec tests [10:40:05] <_joe_> something like openstack::patch_file [10:40:22] <_joe_> or whatever name you prefer [10:40:39] I agree [10:41:23] will share my code when in gerrit [15:38:45] o7 [15:40:19] o8? [15:46:04] jbond42: can you teach me about the capitalization in that patch? I experimented a little and I can see that it's right, but I don't understand why [15:46:42] how come puppetdb finds results for "Class/Role::Grafana" but not "role::grafana" even though it's lower-cased in grafana.pp? [15:47:10] <_joe_> rlazarus: when referring to resource, you capitalize them [15:47:29] <_joe_> so foo::bar { 'something': } => Foo::Bar['something'] [15:47:37] https://puppet.com/docs/puppet/latest/lang_data_resource_reference.html [15:47:42] <_joe_> same in puppetdb, it saves resources capitalized [15:47:51] <_joe_> like you refer to them once they're realized [15:47:54] it's like *p for a pointer dereference in C [15:48:09] huh, okay [15:48:17] that is very weird, thanks [15:48:20] mind bending right? I agree [15:51:26] I guess it's two weird things, it's weird that the language works that way and it's weird that puppetdb searches by the reference and not the type name [15:52:37] ... *and* it's weird that puppetdb doesn't just do a case-insensitive match, since that whole setup guarantees it'll never be ambiguous :) [15:53:16] so there must be something I haven't grokked yet [15:53:44] rlazarus: you will hurt your self if you try to understand all puppets eccentricities ;) [15:53:53] its not you its puppet ;) [15:54:20] haha okay, fair, I guess it's not the first time I've been warned about that [16:00:51] <_joe_> rlazarus: it's a different thing though [16:00:57] <_joe_> one is the declaration of the resource [16:01:03] <_joe_> the other is the /realized/ resource [16:01:07] <_joe_> don't think of it as a pointer [16:01:48] <_joe_> but yes, remember, always, https://bash.toolforge.org/quip/AVfTAUmefIH_7EDsriqu [16:02:16] <_joe_> rlazarus: also there are interesting parser bugs related to capitalization [16:06:27] oh? [16:06:50] I'm fascinated, in the sense of "horrified but I can't look away" [16:15:14] <_joe_> there is some reference in the puppet tree to it [16:15:20] <_joe_> but basically before puppet 5 [16:15:37] <_joe_> capitalization rules meant you could have either type foo::bar::baz [16:15:44] <_joe_> or class foo::bar [16:15:48] <_joe_> but not both [16:15:59] <_joe_> or better [16:16:15] <_joe_> you couldn't use type foo::bar::baz inside any class under foo [16:16:17] <_joe_> :P