I'm trying to implement a custom recursive directory synchronization resource in Puppet. What I need to do is the following.
I have a YAML file with the list of hostnames and the list of directories that should exist on each hostname inside, say,
/var/lib/my_app directory (
host_1: - DIR_1 - DIR_5 host_5: - DIR_7 host_6: - DIR_2 - DIR_3 - DIR_9
On the master I have a directory that contains all of those
DIR_* sub-directories. Each subdirectory contains some files. What I'm trying to achieve is to synchronize all the nodes according to the
deployment.yml, so that
host_1 only contains
DIR_5, but does not contain
DIR_9, and so on.
I tried to do this using the ignore variable for file type, but this does not remove the directories from the node if I remove them from deployment.yml. I tried to write a custom function to remove them afterwards, but it does not seem to work inside my manifest. I also wanted to implement a custom type, but it seems to be too complicated.
I'd appreciate any help on this.