amtega.network_interfaces

Amtega 网络接口角色

这是一个配置 IPv4 网络接口的 Ansible 角色。

角色变量

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

该角色设置了以下信息:

  • network_interfaces_ip_mac_map: 字典,将 IP 地址映射到 MAC 地址

示例剧本

这是一个示例剧本:

---
- name: 网络接口角色示例
  hosts: localhost
  roles:  
    - amtega.network_interfaces
  vars:
    network_interfaces_hostname: "{{ inventory_hostname }}"
    network_interfaces_gateway: 192.168.5.1
    network_interfaces_ipv6: no
    network_interfaces_dns_domain: acme.com
    network_interfaces_dns_search:
      - acme.com
      - acme.org
    network_interfaces_dns_nameserver:
      - 192.168.5.200
      - 192.168.5.201
    network_interfaces_dns_options:
      - timeout:1
      - rotate

    network_interfaces:
      - logicalname: management-01
        macaddress: 08:00:27:06:c1:f8
        ipv4:
          - address: 192.168.5.15
            cidr: 24
        mtu: 1500
        route:
          - net: 192.168.6.0/24
            gateway: 192.168.5.34
        route_multicast: no
        vlanid: 1024
        bond: no      

测试

测试基于 molecule 和 vagrant 虚拟机

cd amtega.network_interfaces

molecule test --all

许可证

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

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

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

该角色的分发是出于希望它能有用的目的,但不提供任何担保;甚至不包括对适销性或特定用途适用性的默示担保。有关更多详细信息,请参阅GNU通用公共许可证或欧洲联盟公共许可证。

作者信息

  • José Enrique Mourón Regueira
  • Juan Antonio Valiño García.
关于项目

Configure ipv4 network interfaces

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