dblenkus.common

ansible-common

Ansible角色用于EL7服务器的常见配置任务。

要求

目前,该角色仅支持CentOSRed Hat Enterprise Linux (RHEL) EL7发行版。

它还要求RHEL/CentOS 7.4或更高版本,因为它提供了一个更新的python-virtualenv软件包(1.10.1-4.el7+),该软件包修复了与Python 3的兼容性(有关更多详细信息,请参见:https://bugzilla.redhat.com/show_bug.cgi?id=1411685)。

如果您需要支持其他版本,请随时提交拉取请求_。

.. _CentOS: https://www.centos.org/ .. _Red Hat Enterprise Linux (RHEL): https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux .. _submit a pull request: https://github.com/dblenkus/ansible-common/pull/new/master

角色变量

remote_user变量自动设置为连接到服务器的用户的whoami命令输出。

+------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | 名称 | 类型 | 描述 | 必填 | 默认值 | +====================================+==========+===========================================+===========+================================================================+ | common_include_security | 布尔值 | 指定是否执行负责安全的角色部分。 | 否 | true | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_include_guest_additions | 布尔值 | 指定是否执行安装VirtualBox来宾附加软件的角色部分。 | 否 | false | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_hostname | 字符串 | 服务器的主机名。 | 否 | "{{ inventory_hostname }}" | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_rhel_repos_for_epel | 列表 | 需要在RHEL机器上启用的EPEL软件库的仓库ID列表。 | 否 | - rhel-7-server-optional-rpms | | | | | | - rhel-7-server-extras-rpms | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_python3_enabled | 布尔值 | 如果为true则安装Python 3.4。 | 否 | false | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_python36_enabled | 布尔值 | 如果为true则安装Python 3.6。 | 否 | false | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_selinux_permisive | 布尔值 | 如果为true则将SELinux设置为宽松模式。 | 否 | false | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_ssh_allowed_ips | 列表 | 允许SSH连接的IP地址列表。 | 否 | [] | | | | | | | | | | .. 警告:: | | | | | | 如果列表为空,将允许所有SSH连接。 | | | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_ssh_authorized_keys | 列表 | 将添加到remote_userauthorized_keys文件的公钥列表。 | 否 | [] | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | vaulted_common_root_password | 字符串 | root的密码。必须是哈希值并存储在Ansible Vault中以确保安全。 | 否 | "" | | | | 有关更多详细信息,请查看 Ansible文档_。 | | | | | | | | | | | | .. 警告:: | | | | | | 如果保留此设置为空,密码将被禁用。 | | | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | vaulted_common_user_password | 字符串 | remote_user的密码。必须是哈希值并存储在Ansible Vault中以确保安全。 | 否 | | | | | 有关更多详细信息,请查看 Ansible文档_。 | | | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_root_ps1 | 字符串 | 如果已定义,rootPS1 bash变量的值。 | 否 | "${BGREEN}\u@\h${NORMAL}:${BBLUE}\w${NORMAL}\\$" | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_user_ps1 | 字符串 | 如果已定义,remote_user的PS1 bash变量值。 | 否 | "${BLUE}(${RED}\w${BLUE}) ${NORMAL}\h ${RED}\\$ ${NORMAL}" | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+ | common_virtualbox_dist_dir | 字符串 | VirtualBox来宾附加软件将下载和解压缩的路径。 | 否 | /opt/virtualbox | | | | | | | +------------------------------------+----------+-------------------------------------------+-----------+----------------------------------------------------------------+

.. _Ansible文档: http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module .. _EPEL软件库: https://fedoraproject.org/wiki/EPEL

依赖关系

无依赖关系。

示例剧本

要使用此角色,将其添加到您的剧本中:

.. code-block:: yaml

- hosts: servers
  roles:
     - { role: domenblenkus.common }

许可证

根据GPLv3许可证授权。有关详细信息,请参见COPYING文件。

作者信息

| Domen Blenkuš | Tadej Janež

关于项目

Common configutation for CentOS 7 server.

安装
ansible-galaxy install dblenkus.common
许可证
gpl-3.0
下载
141
拥有者