diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-04 23:56:35 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-04 23:56:35 -0600 |
| commit | e96c5f84233b40915f7f7e993e1816f3de0d3ab2 (patch) | |
| tree | b1b9e56efdfbf4c9a81cb56c9692b12da358a242 | |
| parent | ed0c745c0f3b0f277968149ca25c78ce374bd2e4 (diff) | |
| parent | 16df87c419655106b1585b1e443a2050270518e5 (diff) | |
| download | puppet-e96c5f84233b40915f7f7e993e1816f3de0d3ab2.tar.gz puppet-e96c5f84233b40915f7f7e993e1816f3de0d3ab2.tar.xz puppet-e96c5f84233b40915f7f7e993e1816f3de0d3ab2.zip | |
Merge commit 'turnbull/0.24.x' into 0.24.x
| -rw-r--r-- | Rakefile | 4 | ||||
| -rwxr-xr-x | bin/puppetrun | 2 | ||||
| -rw-r--r-- | examples/root/etc/puppet/puppet.conf (renamed from examples/root/etc/puppet/puppetmasterd.conf) | 9 | ||||
| -rw-r--r-- | examples/root/etc/puppet/puppetd.conf | 4 | ||||
| -rwxr-xr-x | lib/puppet/provider/package/openbsd.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/type/host.rb | 13 | ||||
| -rw-r--r-- | lib/puppet/type/package.rb | 4 | ||||
| -rwxr-xr-x | test/ral/types/host.rb | 9 |
8 files changed, 32 insertions, 15 deletions
@@ -83,10 +83,6 @@ rule(/_is_runnable$/) do |t| end end -file "debian" => :bzr_is_runnable do - system("bzr get http://www.hezmatt.org/~mpalmer/bzr/puppet.debian.svn debian") || exit(1) -end - task :check_build_deps => 'dpkg-checkbuilddeps_is_runnable' do system("dpkg-checkbuilddeps") || exit(1) end diff --git a/bin/puppetrun b/bin/puppetrun index 5f99d6325..fe981dadf 100755 --- a/bin/puppetrun +++ b/bin/puppetrun @@ -281,7 +281,7 @@ if File.exists? config Puppet.settings.parse(config) end -if Puppet[:ldapnodes] +if Puppet[:node_terminus] = "ldap" if options[:all] hosts = ldapnodes(:all, options[:fqdn]) puts "all: %s" % hosts.join(", ") diff --git a/examples/root/etc/puppet/puppetmasterd.conf b/examples/root/etc/puppet/puppet.conf index b3182075c..151364ebd 100644 --- a/examples/root/etc/puppet/puppetmasterd.conf +++ b/examples/root/etc/puppet/puppet.conf @@ -1,7 +1,10 @@ +[puppetd] +report = true +factsync = true +pluginsync = true + [puppetmasterd] reports = store,rrdgraph,tagmail,log - -[ldap] -ldapnodes = true +node_terminus = ldap ldapserver = culain.madstop.com ldapbase = dc=madstop,dc=com diff --git a/examples/root/etc/puppet/puppetd.conf b/examples/root/etc/puppet/puppetd.conf deleted file mode 100644 index ce988cfa1..000000000 --- a/examples/root/etc/puppet/puppetd.conf +++ /dev/null @@ -1,4 +0,0 @@ -[puppet] -report = true -factsync = true -pluginsync = true diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb index ce69dd432..f76c37176 100755 --- a/lib/puppet/provider/package/openbsd.rb +++ b/lib/puppet/provider/package/openbsd.rb @@ -66,7 +66,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa info = pkginfo @resource[:name] # Search for the version info - if info =~ /Information for #{@resource[:name]}-(\S+)/ + if info =~ /Information for (inst:)?#{@resource[:name]}-(\S+)/ hash[:ensure] = $1 else return nil diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb index be5c2ed72..3e34c0b60 100755 --- a/lib/puppet/type/host.rb +++ b/lib/puppet/type/host.rb @@ -4,6 +4,13 @@ module Puppet newproperty(:ip) do desc "The host's IP address, IPv4 or IPv6." + + validate do |value| + unless value =~ /((([0-9a-fA-F]+:){7}[0-9a-fA-F]+)|(([0-9a-fA-F]+:)*[0-9a-fA-F]+)?::(([0-9a-fA-F]+:)*[0-9a-fA-F]+)?)|((25[0-5]|2[0-4][\d]|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})/ + raise Puppet::Error, "Invalid IP address" + end + end + end newproperty(:alias) do @@ -78,6 +85,12 @@ module Puppet desc "The host name." isnamevar + + validate do |value| + unless value =~ /^\w+-?[\w+]?\.?[\w+.{1}]*\w+$/ + raise Puppet::Error, "Invalid host name" + end + end end @doc = "Installs and manages host entries. For most systems, these diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 9173eaa1c..24b187e5f 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -176,7 +176,7 @@ module Puppet a common name to packages:: # In the 'openssl' class - $ssl = $operationgsystem ? { + $ssl = $operatingsystem ? { solaris => SMCossl, default => openssl } @@ -190,7 +190,7 @@ module Puppet . etc. . - $ssh = $operationgsystem ? { + $ssh = $operatingsystem ? { solaris => SMCossh, default => openssh } diff --git a/test/ral/types/host.rb b/test/ral/types/host.rb index 088f93c1f..16ed20bd4 100755 --- a/test/ral/types/host.rb +++ b/test/ral/types/host.rb @@ -138,8 +138,17 @@ class TestHost < Test::Unit::TestCase host[:ensure] = :absent assert_events([:host_removed], host) end + + def test_invalid_ipaddress + host = mkhost() + + assert_raise(Puppet::Error) { + host[:ip] = "abc.def.ghi.jkl" + } end + end + def test_aliasisproperty assert_equal(:property, @hosttype.attrtype(:alias)) end |
