class LinkAppliedPolicy(Policy): resource = Link name = "apply" default = True signature = ( Present("name"), Present("to"), )
class ServiceStopPolicy(Policy): """ Stop a service if it is running """ resource = Service name = "stop" signature = ( Present("name"), NAND(Present("running"), Present("pidfile")), )
class MountPolicy(Policy): resource = Mount name = "apply" default = True signature = ( Present("name"), Present("fs_type"), Present("device"), )
class ServiceStartPolicy(Policy): """ Start a service if it isn't running """ resource = Service name = "start" default = True signature = ( Present("name"), NAND(Present("running"), Present("pidfile")), )
class CheckoutExportPolicy(Policy): """ Perform an export of the remote location, as for example "svn export". This means this is not a working copy of the remote location, it is instead a clean copy of the specified source material. """ resource = Checkout name = "export" default = False signature = ( Present("name"), Present("repository"), )
class ExecutePolicy(Policy): """ Execute the the command or commands provided. If user or group attributes are provided the command will be run using sudo.""" resource = Execute name = "execute" default = True signature = (Present("name"), XOR(Present("command"), Present("commands")), )
class ServiceReloadPolicy(Policy): """ Get the service to reload its configuration If a service isn't running it will just be started instead. """ resource = Service name = "reconfig" signature = ( Present("name"), NAND(Present("running"), Present("pidfile")), )
class ServiceRestartPolicy(Policy): """ Restart a service If a service isn't running it will just be started instead. """ resource = Service name = "restart" signature = ( Present("name"), NAND(Present("running"), Present("pidfile")), )
class DirectoryAppliedPolicy(Policy): """ Ensure a directory exists and matches the specification provided by the resource. """ resource = Directory name = "apply" default = True signature = ( Present("name"), Present("owner"), Present("group"), Present("mode"), )
class CheckoutSyncPolicy(Policy): """ Synchronise the working copy with the remote SCM location. This is done by performing appropriate "switch" and "update" operations such that the working copy ends up in the correct state. This will never commit changes from the working copy - it is intended to track a remote location only. """ resource = Checkout name = "sync" default = True signature = ( Present("name"), Present("repository"), )
class PromptPolicy(Policy): """ Prompt the operator. The value of the question attribute will be displayed to the operator and deployment will not continue until they acknowledge the prompt.""" resource = Prompt name = "prompt" default = True signature = ( Present("name"), Present("question"), )
class UserApplyPolicy(Policy): """ Create or change the specified user. It might not be possible to apply some changes to existing users, for example the systeam attribute only makes sense at the point a user is created. """ resource = User name = "apply" default = True signature = ( Present("name"), NAND(Present("password"), Present("disabled_login")), )
class FileApplyPolicy(Policy): """ Create a file and populate it's contents if required. You must provide a name. You may provide one of template, static, or encrypted to act as a file source. """ resource = File name = "apply" default = True signature = ( Present("name"), NAND(Present("template"), Present("static"), Present("encrypted")), )
class GroupApplyPolicy(Policy): """ Create the group, or ensure it has the specified attributes. """ resource = Group name = "apply" default = True signature = (Present("name"), )
class LinkRemovedPolicy(Policy): resource = Link name = "remove" default = False signature = ( Present("name"), Absent("to"), )
class PatchApplyPolicy(Policy): """ Apply a patch. You must provide a target. """ resource = Patch name = "apply" default = True signature = (Present("name"), )
class PackageUninstallPolicy(Policy): """ Uninstall the specified package, if it is installed. """ resource = Package name = "uninstall" default = False signature = ( Present("name"), Absent("version"), )
class PackageInstallPolicy(Policy): """ Install the specified package. If the package is already installed it will not be upgraded or changed. Your package upgrade and patching strategy should be independent of Yaybu in general. """ resource = Package name = "install" default = True signature = ( Present("name"), Absent("purge"), )
class GroupRemovePolicy(Policy): """ Remove an existing group if it still exists. You should only specify the name of the group when using this policy.""" resource = Group name = "remove" default = False signature = ( Present("name"), Absent("gid"), Absent("system"), Absent("password"), )
class SpecialAppliedPolicy(Policy): """ Ensure a block or character special file exists """ name = "apply" default = True signature = ( Present("name"), Present("owner"), Present("group"), Present("mode"), Present("type"), Present("major"), Present("minor"), )
class DirectoryRemovedRecursivePolicy(Policy): """ If a directory described by this resource exists then remove it and its children. You should only provided the path to the directory when using this policy. """ resource = Directory name = "remove-recursive" default = False signature = ( Present("name"), Absent("owner"), Absent("group"), Absent("mode"), )
class FileRemovePolicy(Policy): """ Delete a file if it exists. You should only provide the name in this case. """ resource = File name = "remove" default = False signature = ( Present("name"), Absent("owner"), Absent("group"), Absent("mode"), Absent("static"), Absent("template"), Absent("template_args"), )
class SpecialRemovedPolicy(Policy): """ If the special file specified exists, remove it. You should only specify the special file to remove, the other fields are not needed """ name = "remove" default = False signature = ( Present("name"), Absent("owner"), Absent("group"), Absent("mode"), Absent("type"), Absent("major"), Absent("minor"), )
class DirectoryRemovedPolicy(Policy): """ If a directory described by this resource exists then remove it. This isn't recursive, if you want to remove a directory and all its contents use `removed-recursive`. You should only provided the path to the directory when using this policy. """ resource = Directory name = "remove" default = False signature = ( Present("name"), Absent("owner"), Absent("group"), Absent("mode"), )