Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For complex file editing, I strongly encourage you to use augeas. It can check for objects in a certain format (though I think it doesn't check the full ordering) and can make specific changes to parameters in objects. It's quite complicated, but can do quite complicated stuff too. In this case, you would write an augeas resource for 'type', 'boot' and 'bios' objects, which are children of 'os' object.

As for your last suggestion - file -> file_line -> file_line - I understand you want to do some checking in each step. But, from Puppet's logic perspective, I think the result is the opposite of what you expect: if any test fails, Puppet will change the file to make the test pass; and, if the test passes, it doesn't apply the next resource(s). Because that's how resources work - you write the right state, and Puppet enforces it.