saltstack-formulas/users-formula — pull request #26 by slawekp (2014-04-23 13:26:03+00:00)
Title: New format of handling user.absent, supporting additional parameters

My use case was to remove a predefined user from one of our template images, including her home directory. The original users-formula did not provide to support for additional parameters of "user.absent" ("purge" and "force"). Removing a homedir can obviously be achieved some other way, however I wanted this to happen automagically.

This patch adds a support for three additional pillar values: "absent", "purge" and "force". The main *for* loop excludes users in which "absent" in present (pun intended :) and the additional *for* loop goes only through the ones with "absent" and makes use of parameters.

I've provided new examples in the pillar.example file. I also left support for "absent_users" syntax for backwards compatibility.

I'm hoping you will find this modification useful. Thanks.