skx / marionette

Something like puppet, for the localhost only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include-once functionality

adam12 opened this issue · comments

What are your thoughts on preventing literal includes occurring more than once? Maybe store them in a map at the start of the include process?

This won't work for the backticks support but for plain literals it might be OK.

Use case:

# systemd.in
shell triggers {
  name => "Reload systemctl daemon",
  command => "systemctl daemon-reload"
}

# service_1.in
include "systemd.in"

file {
  target => "/etc/systemd/system/service_1.service",
  notify => "Reload systemctl daemon"
}

# service_2.in
include "systemd.in"

file {
  target => "/etc/systemd/system/service_2.service",
  notify => "Reload systemctl daemon"
}

Currently triggers an error about the Reload systemctl daemon name not being unique.

That seems like a sensible enough idea, definitely.

Would you be able to test #39, I think that should work as expected. (But as you say there's the caveat that shell commands won't get duplicated which might be expected.)

Would you be able to test

Worked a treat. Thanks.

Great, thanks for confirming.