Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Empty strings aren't false in Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
charlessimpson committed Jul 29, 2014
1 parent 69163f3 commit 2838614
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions manifests/register_dns.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
define openshift_origin::register_dns($fqdn) {
if $::openshift_origin::register_host_with_nameserver {
if $fqdn != 'localhost' {

$key_algorithm=pick($::openshift_origin::dns_infrastructure_key_algorithm,
$::openshift_origin::bind_key_algorithm)
$key_secret=pick($::openshift_origin::dns_infrastructure_key,
$::openshift_origin::bind_key)
$key_argument="${key_algorithm}:${::openshift_origin::domain}:${key_secret}"

ensure_resource( 'exec', "Register ${fqdn}", {
command => template('openshift_origin/register_dns.erb'),
provider => 'shell'
Expand Down
4 changes: 2 additions & 2 deletions templates/register_dns.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
echo update delete <%= scope.lookupvar('fqdn') %> A
echo update add <%= scope.lookupvar('fqdn') %> 180 A <%= scope.lookupvar('::openshift_origin::node_ip_addr') %>
echo send
) | nsupdate -y <%= scope.lookupvar('::openshift_origin::dns_infrastructure_key_algorithm') or scope.lookupvar('::openshift_origin::bind_key_algorithm') %>:<%= scope.lookupvar('::openshift_origin::domain') %>:<%= scope.lookupvar('::openshift_origin::dns_infrastructure_key') or scope.lookupvar('::openshift_origin::bind_key') %>
) | nsupdate -y <%= @key_argument %>
<% if scope.lookupvar('::openshift_origin::load_balancer_master') and scope.lookupvar('::openshift_origin::broker_virtual_ip_address')%>
(
echo server <%= scope.lookupvar('::openshift_origin::nameserver_ip_addr') %>
echo update delete <%= scope.lookupvar('::openshift_origin::broker_virtual_hostname') %> A
echo update add <%= scope.lookupvar('::openshift_origin::broker_virtual_hostname') %> 180 A <%= scope.lookupvar('::openshift_origin::broker_virtual_ip_address') %>
echo send
) | nsupdate -y <%= scope.lookupvar('::openshift_origin::dns_infrastructure_key_algorithm') or scope.lookupvar('::openshift_origin::bind_key_algorithm') %>:<%= scope.lookupvar('::openshift_origin::domain') %>:<%= scope.lookupvar('::openshift_origin::dns_infrastructure_key') or scope.lookupvar('::openshift_origin::bind_key') %>
) | nsupdate -y <%= @key_argument %>
<% end-%>

0 comments on commit 2838614

Please sign in to comment.