# Example policy illustraing the use of custom promise module # groups_experimental. # # Note: As of 3.18.0, custom promise modules does not support bodies, thus # JSON strings are used to define members for now. promise agent groups_experimental # @brief Define groups_experimental promise type. { path => "$(sys.workdir)/modules/promises/groups_experimental.py"; interpreter => "/usr/bin/python3"; } bundle common foo # @breif Define members for group foo using attributes `include` and # `exclude`. { vars: "members" string => '{ "include": ["alice", "bob"], "exclude": ["malcom"] }'; } bundle common bar # @breif Define members for group bar using attribute `only`. { vars: "members" string => '{ "only": ["alice"] }'; } bundle agent groups_experimental_example # @breif Example groups_experimental promise statements. { groups_experimental: "foo" policy => "present", members => "$(foo.members)"; "bar" # policy defaults to present members => "$(bar.members)", gid => "1234"; "baz" policy => "absent"; } bundle agent example_users # @breif Create users for the groups_experimental example. { users: "alice" policy => "present"; "bob" policy => "present"; "malcom" policy => "present"; } bundle agent __main__ { methods: "example_users"; "groups_experimental_example"; }