Skip to content

Commit

Permalink
Merge pull request #4 from rwaffen/rwaffen_test_gha
Browse files Browse the repository at this point in the history
test GHA
  • Loading branch information
rwaffen authored Aug 8, 2022
2 parents 79415a8 + 38bec49 commit a3a443d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
---
fixtures:
forge_modules:
stdlib: "puppetlabs/stdlib"
stdlib: "puppetlabs/stdlib"
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@

## Table of Contents

1. [Description](#description)
1. [Setup - The basics of getting started with networkmanager](#setup)
* [Setup requirements](#setup-requirements)
1. [Usage - Configuration options and additional functionality](#usage)
1. [Limitations - OS compatibility, etc.](#limitations)
1. [Development - Guide for contributing to the module](#development)
- [networkmanager](#networkmanager)
- [Table of Contents](#table-of-contents)
- [Description](#description)
- [Setup](#setup)
- [Setup Requirements](#setup-requirements)
- [Usage](#usage)
- [Simple Including the module](#simple-including-the-module)
- [Instantiation as a class](#instantiation-as-a-class)
- [Setup of hieradata](#setup-of-hieradata)
- [Parameters](#parameters)
- [Limitations](#limitations)
- [Development](#development)

## Description

Expand All @@ -26,7 +32,7 @@ of the NetworkManager:

## Setup

### Setup Requirements
### Setup Requirements

This module requires following:

Expand All @@ -51,7 +57,7 @@ configuration must be done via hieradata.
include networkmanager
```

or
or

```puppet
contain networkmanager
Expand Down
2 changes: 0 additions & 2 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

# Defaults for Global DNS options
networkmanager::enable_global_dns: false
networkmanagerservers: []
Expand All @@ -19,4 +18,3 @@ networkmanager::ensure_service: 'running'
networkmanager::service_name: 'NetworkManager'
networkmanager::enable_service: true
networkmanager::restart_service: ~

2 changes: 1 addition & 1 deletion lib/facter/networkmanager_nmcli_path.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative '../puppet_x/pixelpark/nm-which'
require_relative '../puppet_x/pixelpark/nm_which'

Facter.add(:networkmanager_nmcli_path) do
setcode do
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions manifests/dns.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

$nmcli = $facts['networkmanager_nmcli_path']

if $connection {
$_connection = $connection
} else {
if empty($connection) {
$_connection = $name
} else {
$_connection = $connection
}

if $nameservers.length() == 1 {
if $nameservers.length == 1 {
notify { "Only one nameserver was given for NetworkManager connection ${_connection}.": loglevel => warning }
}

Expand All @@ -69,7 +69,7 @@
}

$used_searchdomains = $searchdomains.join(',')
$has_searchdomains = $facts['networkmanager_dns'][$_connection]['search'].join(',')
$has_searchdomains = $facts['networkmanager_dns'][$_connection]['search'].join(',')

unless $used_searchdomains == $has_searchdomains {
exec { "update searchdomains nmcli connection ${_connection}":
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/networkmanager_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:params) do
{
service_name: 'foobar',
enable: true,
ensure: 'running',
manage: true,
restart: nil,
}
end

it { is_expected.to compile }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/dns_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
dns_options: '',
}
end
let(:pre_condition) { 'include networkmanager::service' }
let(:pre_condition) { 'class { "networkmanager::service": service_name => "foobar", enable => true, ensure => "running", manage => true, restart => "/bin/foo",}' }

on_supported_os.each do |os, os_facts|
context "on #{os}" do
Expand Down

0 comments on commit a3a443d

Please sign in to comment.