def fields(self): return Fields( self, name=Field(kind=str, help="path to the destination file"), from_file=Field(kind=str, default=None, help="path to a source file"), from_url=Field(kind=str, default=None, help="url to a source file"), from_template=Field(kind=str, default=None, help="path to a source Jinja2 template"), from_content=Field( kind=str, default=None, help="use this string as source data instead of a file"), owner=Field(kind=str, default=None, help="owner name"), group=Field(kind=str, default=None, help="group name"), mode=Field(kind=int, default=None, help="file mode, in hex/octal (not a string)"), absent=Field(kind=bool, default=False, help="if true, delete the file/directory"), overwrite=Field(kind=bool, default=True, help="replace existing files"), )
def fields(self): return Fields( self, name = Field(kind=str, default=None), variables = Field(kind=dict, loader=self.set_variables), roles = Field(kind=list, of=Role, loader=self.set_roles) )
def fields(self): return Fields( self, name = Field(kind=str, default=None), variables = Field(kind=dict, loader=self.set_variables), resources = Field(kind=list, of=Resource, loader=self.set_resources), handlers = Field(kind=dict, of=Resource, loader=self.set_handlers), )
def fields(self): return Fields( self, name=Field(kind=str), started=Field(kind=bool, default=True), enabled=Field(kind=bool, default=True), restarted=Field(kind=bool, default=False), )
def fields(self): return Fields( self, cmd=Field(kind=str, default=None, help="execute this shell code in the default shell"), timeout=Field(kind=int, default=99999, help="max time to allow this command to run"))
def fields(self): return Fields( self, name = Field(kind=str, help="the name of the package to install"), version = Field(kind=str, default=None, help="what version to install"), latest = Field(kind=bool, default=False, help="if true, upgrade the package regardless of version"), absent = Field(kind=bool, default=False, help="if true, remove the package"), update_cache = Field(kind=bool, default=False, help="if true, update the package cache") )
def fields(self): return Fields( self, name=Field(kind=str, help="the name of the group"), gid=Field(kind=int, default=None, help="if set, use this group ID (on creation)"), system=Field( kind=bool, default=False, help="if True, specifies a system group (on creation)"), absent=Field(kind=bool, default=False, help="if True, remove this group"))
def common_field_spec(self, resource): from opsmop.core.field import Field from opsmop.core.resource import Resource # if adding a new field here be sure to add it to COMMON_FIELDS above return dict( when=Field(default=None, lazy=True, help="attaches a condition to this resource"), method=Field(kind=str, default=None, help="selects a non-default provider by name"), ignore_errors=Field( kind=bool, default=False, help="proceeds in the event of most error conditions"), changed_when=Field( default=None, help= "accepts a lambda to determine if a state change should be recorded, whose parameter is the provider result" ), failed_when=Field( default=None, help= "similar to ignore_errors but accepts a lambda function whose parameter is the provider result" ), variables=Field(kind=dict, loader=resource.set_variables, help=None), extra_variables=Field(kind=dict, empty=True, help=None), auto_dispatch=Field(kind=bool, default=True, help=None))
def common_field_spec(self, resource): from opsmop.core.field import Field from opsmop.core.resource import Resource return dict( when = Field(default=None, help="attaches a condition to this resource"), signals = Field(kind=list, of=Resource, default=None, help="signals a handler event by name"), handles = Field(kind=str, default=None, help=None), method = Field(kind=str, default=None, help="selects a non-default provider by name"), register = Field(kind=str, default=None, help="saves the resource result into a named variable"), ignore_errors = Field(kind=bool, default=False, help="proceeds in the event of most error conditions"), variables = Field(kind=dict, loader=resource.set_variables, help=None), extra_variables = Field(kind=dict, empty=True, help=None), )
def fields(self): return Fields( self, name = Field(kind=str, help="path to the destination file"), owner = Field(kind=str, default=None, help="owner name"), group = Field(kind=str, default=None, help="group name"), mode = Field(kind=int, default=None, help="file mode, in hex/octal (not a string)"), absent = Field(kind=bool, default=False, help="if true, delete the file/directory"), recursive = Field(kind=bool, default=False, help="if true, owner, group, and mode become recursive and always run if set") )
def fields(self): return Fields( self, name=Field(kind=str, help="the name of the user account"), group=Field( kind=str, default=None, help="if set, assign the user's primary group (on creation)"), home=Field( kind=str, default=None, help= "if set, override the user's home directory location (on creation)" ), uid=Field( kind=int, default=None, help="if set, use a specific UID for the account (on creation)" ), system=Field( kind=bool, default=False, help="if true, specifies a system account (on creation)"), groups=Field( kind=list, default=None, of=str, help= "if set, assign these groups in addition to the primary groups (on creation)" ), shell=Field(kind=str, default=None, help="if set, assign the user's shell (on creation)"), absent=Field(kind=bool, default=False, help="if True, remove this user account"))
def fields(self): return Fields(self, evals=Field(kind=dict), variable_names=Field(kind=list))
def fields(self): return Fields( self, items = Field(kind=list, of=Resource), )
def fields(self): return Fields( self, msg = Field(kind=str, allow_none=False, help="string to print") )
def fields(self): return Fields(self, variables=Field(kind=dict))
def common_field_spec(self, resource): from opsmop.core.field import Field from opsmop.core.resource import Resource # if adding a new field here be sure to add it to COMMON_FIELDS above return dict( when=Field(default=None, lazy=True, help="attaches a condition to this resource"), signals=Field(kind=list, of=Resource, default=None, help="signals a handler event by name"), handles=Field(kind=str, default=None, help=None), method=Field(kind=str, default=None, help="selects a non-default provider by name"), register=Field( kind=str, default=None, help="saves the resource result into a named variable"), ignore_errors=Field( kind=bool, default=False, help="proceeds in the event of most error conditions"), variables=Field(kind=dict, loader=resource.set_variables, help=None), extra_variables=Field(kind=dict, empty=True, help=None), tags=Field(kind=list, of=str, default=None, help="allows applying part of the policy"), failed_when=Field( default=None, lazy=True, help="if set, specify terms of resource application failure"), changed_when=Field( default=None, lazy=True, help="if set, only signal handlers if this is true"))