Commit fe73bdf5 authored by Alex Tayts's avatar Alex Tayts
Browse files

better boolean processing

parent 8e86b914
require 'puppet/parameter/boolean'
require "digest/md5"
require "etc"
......@@ -25,7 +26,7 @@ Puppet::Type.type(:wallet).provide(:wallet) do
# if file is a keytab, read what's in it
if @resource[:type].to_s == "keytab"
begin
if @resource[:heimdal] == :true
if @resource[:heimdal]
# Heimdal Kerberos is installed
princs = ktutil("-k", @resource[:path], "list").split("\n")
else
......@@ -37,7 +38,7 @@ Puppet::Type.type(:wallet).provide(:wallet) do
# we do not need further verification
exists = (princs.any? { |s| s.include?(@resource[:name]) })
if (exists and (@resource[:verify] == :true))
if (exists and @resource[:verify])
begin
# try to get a ticket with the keytab
kstart("-q", "-f", @resource[:path], @resource[:name])
......@@ -56,7 +57,7 @@ Puppet::Type.type(:wallet).provide(:wallet) do
exists = false
end
else
if @resource[:verify] == :true
if @resource[:verify]
# checksum the wallet object and compare to a
# local file
begin
......
require 'puppet/parameter/boolean'
require 'etc'
Puppet::Type.newtype(:wallet) do
......@@ -51,13 +52,13 @@ Puppet::Type.newtype(:wallet) do
end
end
newparam(:heimdal, :boolean => true) do
newparam(:heimdal, :boolean => true, :parent => Puppet::Parameter::Boolean) do
desc "Kerberos distribution"
defaultto(:false)
newvalues(:true, :false)
end
newparam(:verify, :boolean => true) do
newparam(:verify, :boolean => true, :parent => Puppet::Parameter::Boolean) do
desc "Enable/disable wallet object validation"
defaultto(:false)
newvalues(:true, :false)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment