utils Package

utils Package

Roles in this namespace are meant to provide general utilities within CentOS distributions.

hostname Module

Roles in this namespace are meant to provide hostname utilities methods within CentOS distributions.

class provy.more.centos.utils.hostname.HostNameRole(prov, context)[source]

Bases: provy.core.roles.Role

ensure_hostname(hostname)[source]

Ensure a fixed hostname is configured in the server.

Parameters:hostname (str) – Hostname to be created.

Example:

class MySampleRole(Role):
    def provision(self):
        with self.using(HostNameRole) as role:
            role.ensure_hostname('rabbit')