mrlesmithjr.netplan
目录 由 DocToc 生成
ansible-netplan
要求
你可能想要以 become: true 的方式运行该角色
角色变量
依赖
示例剧本
以下是一个简单的剧本示例,用于设置单个网络接口。有关可以为该角色设置的完整值列表,请参见 defaults/main.yml。
---
- hosts: ...你的主机...
  any_errors_fatal: true
  roles:
    - role: mrlesmithjr.netplan
      become: yes
      # 如果 netplan_enabled 为 true,则该角色才会执行。
      netplan_enabled: true
      
      # 这应该指向你系统上已存在的 netplan 配置文件,
      # 该角色将覆盖它,
      # 或指向 netplan 知道的一个不存在的文件。
      #
      # 默认是 /etc/netplan/config.yaml。
      netplan_config_file: /etc/netplan/my-awesome-netplan.yaml
      
      # 例如,Ubuntu 18.04 默认使用 networkd。
      netplan_renderer: networkd
      # 简单的网络配置,用于添加单个网络接口。
      # 以下定义的配置将写入上面定义的 `netplan_config_file` 文件。
      netplan_configuration:
        network:
          version: 2
          ethernets:
            enp28s0f7:
              addresses:
                - 10.11.12.99/24
使用加密变量
加密变量需要在 netplan_configuration 变量之外定义,以便被评估。
netplan_configuration:
  network:
    version: 2
    tunnels:
      wg_test:
        mode: wireguard
        key: "{{ my_wireguard_private_key }}"
      ....
my_wireguard_private_key: !vault |
          31366530666465373834386563636465636135323562303866363333333865376330303130363162
          ....
许可证
MIT
作者信息
Larry Smith Jr.
关于项目
 An [Ansible](https://www.ansible.com) role to manage [Netplan](https://netplan.io)
安装
 ansible-galaxy install mrlesmithjr.netplan许可证
 
            mit
          
下载
 
            1.1M
          
拥有者
 Sharing practical insights on virtualization, cloud, automation, and DevOps to help others build, automate, and innovate with confidence.

