Ejemplo n.º 1
0
    )

src_dir = '/usr/local/src'
dest = src_dir + '/pyinfra'

files.directory(
    name='Ensure the src_dir directory exists',
    path=src_dir,
)

# Clone the pyinfra repo to do some pyinfra development
git.repo(
    name='Clone repo',
    src='https://github.com/Fizzadar/pyinfra.git',
    dest=dest,
)

git.config(
    name='Ensure user name is set for a repo',
    key='user.name',
    value='Anon E. Mouse',
    repo=dest,
)

git.config(
    name='Ensure email is set for a repo',
    key='user.email',
    value='*****@*****.**',
    repo=dest,
)
Ejemplo n.º 2
0
    present=False,
)

# Add/remove/add same brew tap
brew.tap("sometap/somewhere", )

brew.tap(
    "sometap/somewhere",
    present=False,
)

brew.tap("sometap/somewhere", )

# Add/change/add same git config
git.config(
    "somekey",
    "somevalue",
)

git.config(
    "somekey",
    "someothervalue",
)

git.config(
    "somekey",
    "somevalue",
)

# Start/stop/start same systemd service
systemd.service("someservice", )
Ejemplo n.º 3
0
src_dir = "/usr/local/src"
dest = src_dir + "/pyinfra"

files.directory(
    name="Ensure the src_dir directory exists",
    path=src_dir,
)

# Clone the pyinfra repo to do some pyinfra development
git.repo(
    name="Clone repo",
    src="https://github.com/Fizzadar/pyinfra.git",
    dest=dest,
    branch=None,  # use the default branch
)

git.config(
    name="Ensure user name is set for a repo",
    key="user.name",
    value="Anon E. Mouse",
    repo=dest,
)

git.config(
    name="Ensure email is set for a repo",
    key="user.email",
    value="*****@*****.**",
    repo=dest,
)