Skip to content

Commit

Permalink
Merge pull request #169 from jordiprats/master
Browse files Browse the repository at this point in the history
release 0.2.14
  • Loading branch information
jordiprats authored Dec 3, 2019
2 parents fd9e555 + 57b269a commit 6917069
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 0.2.14

* Added domains option to **systemd::resolved** - fixes [issue 186](https://github.com/NTTCom-MS/eyp-systemd/issues/168)
* Added Resolve section - fixes [issue 167](https://github.com/NTTCom-MS/eyp-systemd/issues/167)
* Allow multiple oncalendar for **systemd::timer** - thanks to [TuningYourCode](https://github.com/TuningYourCode) for this [PR-166](https://github.com/NTTCom-MS/eyp-systemd/pull/166)

## 0.2.13

* added basic **tmpfiles.d** support using **systemd::tmpfile**
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ Base class for refreshing systemd on demand
* **dns_stub_listener**: (default: true)
* **dnssec**: (default: false)
* **cache**: (default: true)
* **domains**: A space-separated list of domains. These domains are used as search suffixes when resolving single-label host names (default: [])

#### systemd::logind

Expand Down
1 change: 1 addition & 0 deletions manifests/resolved.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$dns_stub_listener = true,
$dnssec = false,
$cache = true,
$domains = [],
) inherits systemd::params {


Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyp-systemd",
"version": "0.2.13",
"version": "0.2.14",
"author": "eyp",
"summary": "management of systemd services, services dropins, sockets, timers, mounts, automounts, tmpfiles, timesyncd, journald, logind and resolved",
"license": "Apache-2.0",
Expand Down
16 changes: 16 additions & 0 deletions spec/defines/timer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
.with_content(/^OnCalendar=06:00:00$/)
end
end
context 'with multiple calendar parameters' do
let(:params) do
{
on_calendar: [
'06:00:00',
'08:00:00',
]
}
end
it { should compile.with_all_deps }
it do
should contain_file('/etc/systemd/system/foobar.timer')
.with_content(/^OnCalendar=06:00:00$/)
.with_content(/^OnCalendar=08:00:00$/)
end
end
context 'with on_boot_sec parameters' do
let(:params) do
{
Expand Down
7 changes: 6 additions & 1 deletion templates/resolved.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]

<% if @dns.any? -%>
DNS=<%= @dns.join(' ') %>
<% end -%>
<% if @fallback_dns.any? -%>
FallbackDNS=<%= @fallback_dns.join(' ') %>
<% end -%>
#Domains=
<% if @domains.any? -%>
Domains=<%= @domains.join(' ') %>
<% end -%>
#LLMNR=no
#MulticastDNS=no
DNSSEC=<%= scope.function_bool2yesno([@dnssec]) %>
Expand Down
4 changes: 3 additions & 1 deletion templates/section/timer.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
%w(on_active_sec on_boot_sec on_startup_sec on_unit_active_sec on_unit_inactive_sec on_calendar accuracy_sec randomized_delay_sec unit persistent wake_system remain_after_elapse).each do | variableName |
-%>
<%- if scope[variableName].to_s != 'undef' and !scope[variableName].nil? -%>
<%= variableName.gsub(/(^(.)|_(.))/){|match| match.upcase }.gsub('_', '') -%>=<%= scope[variableName] %>
<%- Array(scope[variableName]).each do | value | -%>
<%= variableName.gsub(/(^(.)|_(.))/){|match| match.upcase }.gsub('_', '') -%>=<%= value %>
<%- end -%>
<%- end -%>
<% end -%>

0 comments on commit 6917069

Please sign in to comment.