Bug #4946
Updated by Ben Hughes over 1 year ago
The dependencies before/require in 2.6 can be abbreviated with -> or <-. There appears to be a bug with more than one element in a resource block.
These both fail irrespective of whitespace:
<pre>class pkgs {
package { ["mysql", "httpd"]:
ensure => present,
} ->
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
<pre>class pkgs {
package {
"mysql": ensure => present;
"httpd": ensure => present,
} ->
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
And they fail with this error:
<pre>Could not find resource 'Package[mysql]Package[httpd]' for relationship on 'Service[httpd]' on node localhost.localdomain</pre>
This succeeds, as expected:
<pre>class pkgs {
package { ["mysql", "httpd"]:
ensure => present,
before => Service["httpd"],
}
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
Having a single package in the package resource block succeeds with the "->" syntax.
CentOS 5.5<br />
Puppet 2.6.1
These both fail irrespective of whitespace:
<pre>class pkgs {
package { ["mysql", "httpd"]:
ensure => present,
} ->
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
<pre>class pkgs {
package {
"mysql": ensure => present;
"httpd": ensure => present,
} ->
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
And they fail with this error:
<pre>Could not find resource 'Package[mysql]Package[httpd]' for relationship on 'Service[httpd]' on node localhost.localdomain</pre>
This succeeds, as expected:
<pre>class pkgs {
package { ["mysql", "httpd"]:
ensure => present,
before => Service["httpd"],
}
service { "httpd":
ensure => running,
}
}
include pkgs</pre>
Having a single package in the package resource block succeeds with the "->" syntax.
CentOS 5.5<br />
Puppet 2.6.1