Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smart_proxy_dns_route53 plugin support #656

Merged
merged 4 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions manifests/plugin/dns/route53.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @summary Install the Amazon Route53 DNS plugin for Foreman proxy
#
# @param aws_access_key
# The Access Key ID of the IAM account
#
# @param aws_secret_key
# The Secret Access Key of the IAM account
#
class foreman_proxy::plugin::dns::route53 (
String $aws_access_key,
String $aws_secret_key,
) {
foreman_proxy::plugin::provider { 'dns_route53':
}
}
33 changes: 33 additions & 0 deletions spec/classes/foreman_proxy__plugin__dns__route53_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'spec_helper'

describe 'foreman_proxy::plugin::dns::route53' do
on_plugin_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) { 'include foreman_proxy' }

context 'explicit parameters' do
let :params do
{
:aws_access_key => 'ABCDEF123456',
:aws_secret_key => 'changeme',
}
end

it { should compile.with_all_deps }

it 'should install the correct plugin' do
should contain_foreman_proxy__plugin('dns_route53')
end

it 'should contain the correct configuration' do
verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/dns_route53.yml', [
'---',
':aws_access_key: "ABCDEF123456"',
':aws_secret_key: "changeme"',
])
end
end
end
end
end
5 changes: 4 additions & 1 deletion templates/dns.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
:enabled: <%= @module_enabled %>
# valid providers:
# dns_dnscmd (Microsoft Windows native implementation)
# dns_infoblox (separate plugin)
# dns_libvirt (dnsmasq via libvirt)
# dns_nsupdate
# dns_nsupdate_gss (for GSS-TSIG support)
# dns_libvirt (dnsmasq via libvirt)
# dns_powerdns (separate plugin)
# dns_route53 (separate plugin)
:use_provider: dns_<%= scope.lookupvar("foreman_proxy::dns_provider") %>
# use this setting if you want to override default TTL setting (86400)
:dns_ttl: <%= scope.lookupvar("foreman_proxy::dns_ttl") %>
3 changes: 3 additions & 0 deletions templates/plugin/dns_route53.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
:aws_access_key: "<%= scope.lookupvar('foreman_proxy::plugin::dns::route53::aws_access_key') %>"
:aws_secret_key: "<%= scope.lookupvar('foreman_proxy::plugin::dns::route53::aws_secret_key') %>"