Module Expr Str ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str 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 NameParam NameParam NameParam defaults Dict Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad 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 defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Dict body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad 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 `Nginx <http://wiki.nginx.org/Main>`_ web server utility methods for Debian distributions.
 provy.core Role provy.more.debian.package.aptitude AptitudeRole NginxRole N/A Role N/A N/A 
    This role provides `Nginx <http://wiki.nginx.org/Main>`_ web server management utilities for Debian distributions.

    Example:
    ::

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

        class MySampleRole(Role):
            def provision(self):
                with self.using(NginxRole) as role:
                    role.ensure_conf(conf_template='nginx.conf')
                    role.ensure_site_disabled('default')
                    role.create_site(site='my-site', template='my-site')
                    role.ensure_site_enabled('my-site')
     __available_site_for N/A N/A self name N/A N/A N/A N/A /etc/nginx/sites-available/%s name N/A __enabled_site_for N/A N/A self name N/A N/A N/A N/A /etc/nginx/sites-enabled/%s name N/A provision N/A N/A self N/A N/A N/A 
        Installs `Nginx <http://wiki.nginx.org/Main>`_ dependencies.
        This method should be called upon if overriden in base classes, or `Nginx <http://wiki.nginx.org/Main>`_ won't work properly in the remote server.

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    self.provision_role(NginxRole) # does not need to be called if using with block.
         N/A N/A N/A self using AptitudeRole role N/A N/A N/A N/A role ensure_up_to_date N/A N/A N/A role ensure_package_installed nginx N/A cleanup N/A N/A self N/A N/A N/A 
        Restarts nginx if any changes have been made.
        There's no need to call this method manually.
         N/A N/A N/A N/A super NginxRole self cleanup N/A N/A N/A must-restart-nginx N/A self context N/A N/A self context N/A must-restart-nginx N/A N/A N/A N/A self restart N/A ensure_conf N/A N/A self conf_template options nginx_conf_path N/A N/A /etc/nginx/nginx.conf N/A N/A 
        Ensures that nginx configuration is up-to-date with the specified template.

        :param conf_template: Name of the template for nginx.conf.
        :type conf_template: :class:`str`
        :param options: Dictionary of options passed to template. Extends context.
        :type options: :class:`dict`
        :param nginx_conf_path: Path of the nginx configuration file. Defaults to /etc/nginx/nginx.conf.
        :type nginx_conf_path: :class:`str`

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.ensure_conf(conf_template='nginx.conf')
         N/A result N/A N/A self update_file conf_template nginx_conf_path options options sudo True N/A result N/A N/A N/A N/A self log nginx conf updated! N/A N/A N/A self ensure_restart N/A ensure_site_disabled N/A N/A self site N/A N/A N/A 
        Ensures that the specified site is removed from nginx list of enabled sites.

        :param site: Name of the site to disable.
        :type site: :class:`str`

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.ensure_site_disabled('default')
         N/A result N/A N/A self remove_file N/A N/A self __enabled_site_for site sudo True N/A result N/A N/A N/A N/A self log N/A %s nginx site is disabled! site N/A N/A N/A self ensure_restart N/A ensure_site_enabled N/A N/A self site N/A N/A N/A 
        Ensures that a symlink is created for the specified site at nginx list of enabled sites from the list of available sites.

        :param site: Name of the site to enable.
        :type site: :class:`str`

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.ensure_site_enabled('my-site')
         N/A result N/A N/A self remote_symlink N/A N/A self __available_site_for site N/A N/A self __enabled_site_for site sudo True N/A result N/A N/A N/A N/A self log N/A %s nginx site is enabled! site N/A N/A N/A self ensure_restart N/A create_site N/A N/A self site template options N/A N/A N/A N/A 
        Adds a website with the specified template to Nginx list of available sites.

        Warning: Do not forget to call :meth:`ensure_site_enabled` after a call to `create_site`, or your site won't be enabled.

        :param site: Name of the site to enable.
        :type site: :class:`str`
        :param template: Site configuration template.
        :type template: :class:`str`
        :param options: Options to pass to the template.
        :type options: :class:`str`

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.create_site(site='my-site', template='my-site', options={
                            "user": "me"
                        })
         N/A result N/A N/A self update_file template N/A N/A self __available_site_for site options options sudo True N/A result N/A N/A N/A N/A self log N/A %s nginx site created! site N/A N/A N/A self ensure_restart N/A ensure_restart N/A N/A self N/A N/A N/A 
        Ensures that nginx gets restarted on cleanup. There's no need to call this method as any changes to Nginx will trigger it.

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.ensure_restart()
         N/A N/A N/A self context N/A must-restart-nginx True N/A restart N/A N/A self N/A N/A N/A 
        Forcefully restarts Nginx.

        Example:
        ::

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

            class MySampleRole(Role):
                def provision(self):
                    with self.using(NginxRole) as role:
                        role.restart()
         N/A command /etc/init.d/nginx restart N/A N/A N/A self execute command sudo True N/A N/A