amtega.etc_hosts

Ansible etc_hosts 角色

这是一个管理 /etc/hosts 条目的 Ansible 角色。

要求

控制机器上需要安装 dnspython 1.15.0+

角色变量

该角色所有默认变量的列表可以在 defaults/main.yml 中找到。

示例剧本

以下是一个示例剧本:

---

- hosts: all
  roles:
    - amtega.etc_hosts
  vars:    
    etc_hosts:
      - address: 192.168.13.12
        state: present
        hostnames:
          - acme1
          - acme2
      - address: 192.168.13.13
        state: present
        hostnames:
          - acme3
          - acme4
      - hostnames:
          - www.google.com
          - www.centos.org
        state: present                    

测试

测试基于 使用 vagrant 虚拟机的 molecule

cd amtega.etc_hosts

molecule test --all

许可证

版权所有 (C) 2022 AMTEGA - 加利西亚自治区

该角色是自由软件:您可以根据以下条款重新分发和/或修改它:

GNU 通用公共许可证第 3 版,或(根据您的选择)任何更高版本;或欧洲联盟公共许可证,版本 1.2 或 - 一旦获得欧洲委员会批准 - 随后的 EUPL 版本。

该角色的分发希望能有用,但不提供任何担保;甚至不提供适销性或特定用途适用性的隐含担保。详细信息请参见 GNU 通用公共许可证或欧洲联盟公共许可证。

作者信息

  • Juan Antonio Valiño García。
关于项目

Manage /etc/hosts entries

安装
ansible-galaxy install amtega.etc_hosts
许可证
gpl-3.0
下载
7.3k
拥有者
Agency for Technological Modernization of Galicia