Skip to content

Latest commit

 

History

History
197 lines (116 loc) · 4 KB

File metadata and controls

197 lines (116 loc) · 4 KB

Reference

Table of Contents

Classes

  • netplan: Install and configure netplan

Defined types

Classes

netplan

Manages the installation of netplan and controls global options like whether to purge unmanaged files.

Examples

Basic usage
include netplan
Purge un-managed files
class { netplan:
  purge_configs => true,
}
Purge un-managed files, but ignore a given pattern
class { netplan:
  purge_configs => true,
  purge_ignore  => '90-NM*'
}

Parameters

The following parameters are available in the netplan class:

package_dependencies

Data type: Array

List of packages to install

Default value: ['netplan.io']

manage_dependencies

Data type: Boolean

Whether to install the list of package dependencies or not

Default value: true

apply

Data type: Boolean

Whether to apply the netplan configuration during the agent run or not

Default value: true

purge_configs

Data type: Boolean

Whether to purge un-managed netplan YAML files under /etc/netplan

Default value: false

purge_ignore

Data type: Optional[String]

Match files to ignore when purging configs under /etc/netplan. Uses the ignore attribute of the native puppet file resource.

Default value: undef

configs

Data type: Optional[Hash]

An optional hash of netplan configurations supplied via hiera

Default value: undef

Defined types

netplan::config

Create netplan YAML files from a Hash of data.

Examples

Basic config
netplan::config { 'example-config':
  settings => {
    version => 2,
    renderer => networkd,
    ethernets => {
      eth0 => {
        dhcp4 => true,
      },
    },
  },
}

Parameters

The following parameters are available in the netplan::config defined type:

ensure

Data type: Enum['present','absent']

Ensure presence/absence of the resource

Default value: 'present'

file_name

Data type: String

The filename to use for the generated YAML file

Default value: $title

priority

Data type: Variant[String, Integer[0]]

The string/number prefixed to the generated YAML file

Default value: 90

file

Data type: Stdlib::Absolutepath

The absolute path of the genrated YAML file

Default value: "/etc/netplan/${priority}-${file_name}.yaml"

file_mode

Data type: String

The file permissions for the generated YAML file

Default value: '0600'

header

Data type: String

The file header for the generated YAML file

Default value: '# This file is managed by Puppet. DO NOT EDIT.'

settings

Data type: Hash

A hash of netplan settings to be included in the generated YAML file

Default value: {}