Пример #1
0
    server.user,
    user='******',
    home='/home/pyinfra',
    shell='/bin/bash',
    sudo=True,
)

add_op(
    state,
    server.group,
    group='pyinfra2',
    name='Ensure pyinfra2 group exists',
    sudo=True,
    # Add an op only to a subset of hosts
    # (in this case, the inventory.centos group)
    host=inventory.get_group('centos', default=[]),
)

# Ensure the state of files
add_op(
    state,
    files.file,
    path='/var/log/pyinfra.log',
    user='******',
    group='pyinfra',
    mode='644',
    sudo=True,
)

# Ensure the state of directories
add_op(
Пример #2
0
    server.user,
    user="******",
    home="/home/pyinfra",
    shell="/bin/bash",
    sudo=True,
)

add_op(
    state,
    server.group,
    group="pyinfra2",
    name="Ensure pyinfra2 group exists",
    sudo=True,
    # Add an op only to a subset of hosts
    # (in this case, the inventory.centos group)
    host=inventory.get_group("centos", default=[]),
)

# Ensure the state of files
add_op(
    state,
    files.file,
    path="/var/log/pyinfra.log",
    user="******",
    group="pyinfra",
    mode="644",
    sudo=True,
)

# Ensure the state of directories
add_op(
Пример #3
0
    'pyinfra',
    home='/home/pyinfra',
    shell='/bin/bash',
    sudo=True,
)

add_op(
    state,
    server.group,
    {'Ensure pyinfra2 group exists'
     },  # set as the first arg names the operation
    'pyinfra2',
    sudo=True,
    # Add an op only to a subset of hosts
    # (in this case, the inventory.centos group)
    hosts=inventory.get_group('centos'),
)

# Ensure the state of files
add_op(
    state,
    files.file,
    '/var/log/pyinfra.log',
    user='******',
    group='pyinfra',
    mode='644',
    sudo=True,
)

# Ensure the state of directories
add_op(