Module Expr Str ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Dict NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Dict NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr If BoolOpAnd CompareIn Str AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list decorator_list
N/A N/A 
Roles in this namespace are meant to provide `Varnish <https://www.varnish-cache.org/>`_ configuration and execution utilities within Debian distributions.
 provy.core Role provy.more.debian.package.aptitude AptitudeRole VarnishRole N/A Role N/A N/A 
    This role provides utility methods for Varnish configuration and execution within Debian distributions.

    Example:
    ::

        from provy.core import Role
        from provy.more.debian import VarnishRole

        class MySampleRole(Role):
            def provision(self):
                with self.using(VarnishRole) as role:
                    role.ensure_vcl('default.vcl', owner='user')
                    role.ensure_conf('default_varnish', owner='user')
     provision N/A N/A self N/A N/A N/A 
        Installs `Varnish <https://www.varnish-cache.org/>`_ and its dependencies.
        This method should be called upon if overriden in base classes, or Varnish won't work properly in the remote server.

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    self.provision_role(VarnishRole) # does not need to be called if using with block.
         N/A N/A N/A self using AptitudeRole aptitude N/A N/A N/A N/A aptitude ensure_package_installed varnish N/A ensure_vcl N/A N/A self template varnish_vcl_path options owner N/A /etc/varnish/default.vcl N/A None N/A N/A 
        Ensures that the VCL file at the specified path is up-to-date.

        :param template: The name of the VCL template file.
        :type template: :class:`str`
        :param varnish_vcl_path: The path that the VCL file will be in the remote server. Defaults to `/etc/varnish/default.vcl`.
        :type varnish_vcl_path: :class:`str`
        :param options: Dictionary of options to pass to the VCL template file. Extends context.
        :type options: :class:`dict`
        :param owner: Owner of the VCL file at the remote server. Defaults to :data:`None`.
        :type owner: :class:`str`

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    with self.using(VarnishRole) as role:
                        role.ensure_vcl('default.vcl', owner='user')
         N/A result N/A N/A self update_file template varnish_vcl_path options options sudo True owner owner N/A result N/A N/A N/A N/A self log varnish vcl updated! N/A N/A N/A self ensure_restart N/A ensure_conf N/A N/A self template varnish_conf_path options owner N/A /etc/default/varnish N/A None N/A N/A 
        Ensures that Varnish's configuration file at the specified path is up-to-date.

        :param template: The name of the VCL template file.
        :type template: :class:`str`
        :param varnish_conf_path: The path that the configuration file will be in the remote server. Defaults to `/etc/default/varnish`.
        :type varnish_conf_path: :class:`str`
        :param options: Dictionary of options to pass to the configuration template file. Extends context.
        :type options: :class:`dict`
        :param owner: Owner of the configuration file at the remote server. Defaults to :data:`None`.
        :type owner: :class:`str`

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    with self.using(VarnishRole) as role:
                        role.ensure_conf('default_varnish', owner='user')
         N/A result N/A N/A self update_file template varnish_conf_path options options sudo True owner owner N/A result N/A N/A N/A N/A self log varnish conf updated! N/A N/A N/A self ensure_restart N/A cleanup N/A N/A self N/A N/A N/A 
        Restarts Varnish if it needs to be restarted (any changes made during this server's provisioning).

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    with self.using(VarnishRole) as role:
                        role.cleanup() # No need to call this if using a with block.
         N/A N/A N/A N/A super VarnishRole self cleanup N/A N/A N/A must-restart-varnish N/A self context N/A N/A self context N/A must-restart-varnish N/A N/A N/A N/A self restart N/A ensure_restart N/A N/A self N/A N/A N/A 
        Ensures that Varnish is restarted on cleanup phase.

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    with self.using(VarnishRole) as role:
                        role.ensure_restart() # No need to call this if using a with block.
         N/A N/A N/A self context N/A must-restart-varnish True N/A restart N/A N/A self N/A N/A N/A 
        Forcefully restarts Varnish in the remote server.

        Example:
        ::

            from provy.core import Role
            from provy.more.debian import VarnishRole

            class MySampleRole(Role):
                def provision(self):
                    with self.using(VarnishRole) as role:
                        if not self.is_process_running('varnishd'):
                            role.restart()
         N/A command START=yes /etc/init.d/varnish restart N/A N/A N/A self execute command sudo True N/A N/A