Skip to content

Commit

Permalink
Merge pull request #2 from jordiprats/master
Browse files Browse the repository at this point in the history
bugfix varis
  • Loading branch information
jordiprats authored May 17, 2018
2 parents 9f3a61c + 484080c commit 6d97cb6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# CHANGELOG

## 0.1.3

* bugfix: search option implementation

## 0.1.2

* bugfix yaml syntax

## 0.1.1

* **netplan::interface**:
- filename option
- added **search** option to configure search domains

## 0.1.0

* initial release
7 changes: 7 additions & 0 deletions examples/defaultDNS.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
netplan::interface { 'all':
dev => 'resolversallinterfaces',
match => true,
match_name => '*',
dns => [ '1.1.1.1', '8.8.8.8' ],
search => [ 'demo.vm', 'demo2.vm' ],
}
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
$netplan_dir_purge = false,
) inherits netplan::params{

include ::systemd::resolved

Class['::systemd::resolved'] ->
class { '::netplan::install': }
-> class { '::netplan::config': }
-> Class['::netplan']
Expand Down
4 changes: 3 additions & 1 deletion manifests/interface.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define netplan::interface (
$dev = $name,
$filename = $name,
$match = false,
$match_name = undef,
$match_macaddress = undef,
Expand All @@ -8,6 +9,7 @@
$gateway4 = undef,
$gateway6 = undef,
$dns = [],
$search = [],
$dhcp4 = undef,
$dhcp6 = undef,
$optional = undef,
Expand All @@ -16,7 +18,7 @@
) {
include ::netplan

file { "/etc/netplan/${order}-${dev}.yaml":
file { "/etc/netplan/${order}-${filename}.yaml":
ensure => 'present',
owner => 'root',
group => 'root',
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyp-netplan",
"version": "0.1.0",
"version": "0.1.3",
"author": "eyp",
"summary": "network management using netplan.io",
"license": "Apache-2.0",
Expand All @@ -10,6 +10,7 @@
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 1.0.0 < 9.9.9"},
{"name":"puppetlabs/concat","version_requirement":">= 1.2.3 < 3.0.0"},
{"name":"eyp/systemd","version_requirement":">= 0.1.43 < 0.2.0"},
{"name":"eyp/eyplib","version_requirement":">= 0.1.0 < 0.2.0"}
],
"operatingsystem_support": [
Expand Down
7 changes: 5 additions & 2 deletions templates/interface.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
network:
version: 2
ethernets:
<%= @dev %>:
'<%= @dev %>':
<%- if @match -%>
match:
<%- if defined?(@match_name) -%>
name: <%= @match_name %>
name: '<%= @match_name %>'
<%- end -%>
<%- if defined?(@match_macaddress) -%>
macaddress: <%= @match_macaddress %>
Expand Down Expand Up @@ -37,6 +37,9 @@ network:
<%- if @dns.any? -%>
nameservers:
addresses: [<%= @dns.join(',') %>]
<%- if @search.any? -%>
search: [<%= @search.join(',') %>]
<%- end -%>
<%- end -%>
<%- if defined?(@macaddress) -%>
macaddress: <%= @macaddress %>
Expand Down

0 comments on commit 6d97cb6

Please sign in to comment.