Exemple #1
0
    server.hostname(
        name='Set the hostname for an agent',
        hostname='agent.example.com',
    )

if host.fact.linux_name in ['CentOS', 'RedHat']:

    yum.packages(
        name='Install chrony for Network Time Protocol (NTP)',
        packages=['chrony'],
    )

    major = host.fact.linux_distribution['major']
    yum.rpm(
        name='Install Puppet Repo',
        src='https://yum.puppet.com/puppet6-release-el-{}.noarch.rpm'.format(
            major),
    )

    files.line(
        name='Ensure SELINUX is disabled',
        path='/etc/sysconfig/selinux',
        line=r'SELINUX=.*',
        replace='SELINUX=disabled',
    )

    # TODO: should reboot after SELINUX is disabled (how to check/easy way to reboot)
    # TODO: how to determine when reboot is complete
    # TODO: run sestatus

if host in masters:
Exemple #2
0
    server.hostname(
        name="Set the hostname for an agent",
        hostname="agent.example.com",
    )

if host.get_fact(LinuxName) in ["CentOS", "RedHat"]:

    yum.packages(
        name="Install chrony for Network Time Protocol (NTP)",
        packages=["chrony"],
    )

    major = host.get_fact(LinuxDistribution)["major"]
    yum.rpm(
        name="Install Puppet Repo",
        src="https://yum.puppet.com/puppet6-release-el-{}.noarch.rpm".format(
            major),
    )

    files.line(
        name="Ensure SELINUX is disabled",
        path="/etc/sysconfig/selinux",
        line=r"SELINUX=.*",
        replace="SELINUX=disabled",
    )

    # TODO: should reboot after SELINUX is disabled (how to check/easy way to reboot)
    # TODO: how to determine when reboot is complete
    # TODO: run sestatus

if host in masters:
Exemple #3
0
        packages=['vim-enhanced', 'vim', 'wget'],
        update=True,
    )

linux_id = host.fact.linux_distribution['release_meta'].get('ID')
print(linux_id)

if host.fact.linux_name == 'CentOS':
    yum.key(
        name='Add the Docker CentOS gpg key',
        src='https://download.docker.com/linux/{}/gpg'.format(linux_id),
    )

yum.rpm(
    name='Ensure an rpm is not installed',
    src='snappy',
    present=False,
)

if host.fact.linux_name in ['CentOS', 'RedHat']:
    yum.rpm(
        name='Install EPEL rpm to enable EPEL repo',
        src='https://dl.fedoraproject.org/pub/epel/epel-release-latest-'
        '{{  host.fact.linux_distribution.major }}.noarch.rpm',
    )

    yum.packages(
        name='Install Zabbix and htop',
        packages=['zabbix', 'htop'],
        update=True,
    )
Exemple #4
0
        packages=["vim-enhanced", "vim", "wget"],
        update=True,
    )

linux_distribution = host.get_fact(LinuxDistribution)
linux_id = linux_distribution["release_meta"].get("ID")

if host.get_fact(LinuxName) == "CentOS":
    yum.key(
        name="Add the Docker CentOS gpg key",
        src="https://download.docker.com/linux/{}/gpg".format(linux_id),
    )

yum.rpm(
    name="Ensure an rpm is not installed",
    src="snappy",
    present=False,
)

if host.get_fact(LinuxName) in ["CentOS", "RedHat"]:
    yum.rpm(
        name="Install EPEL rpm to enable EPEL repo",
        src="https://dl.fedoraproject.org/pub/epel/epel-release-latest-"
        "{0}.noarch.rpm".format(linux_distribution["major"]),
    )

    yum.packages(
        name="Install Zabbix and htop",
        packages=["zabbix", "htop"],
        update=True,
    )