Ubuntu – Clear Directory with Salt State File

saltstacksupervisordUbuntu

How do I clear a directory on a salt-minion using a state file? I want to delete all *.conf files in /etc/supervisord/conf.d/ before I set up other supervisor services.

The following top.sls configuration has no effect:

/etc/supervisor/conf.d/*:
  file.absent

file.remove fails as being unavailable.

Best Answer

Had same issue as you. That's what worked for me.

remove-supervisord-confd:
   file.directory:
      - name: /etc/supervisord/conf.d/           
      - clean: True