On Thu 25 Oct 2012 06:53:24 PM IST, jcbollinger wrote:
You're still confusing me. Your initial message led me to believe
that your two ucarp instances are supposed to run on different hosts.
Did I misunderstand?
In total, there will be four ucarp instances. Two running on two
different machines. The issue here is that, the file resources defined
inside the user-defined ucarp::host::config resource is throwing the
error. I am not sure how do I solve that.
Meanwhile, I had a look at
https://github.com/bodepd/puppet-ensure_resource and this kind of
solved my problem. I was able to do what I intended by wrapping the
file resources defined inside the ucarp::host::config inside
ensure_resource. Everything worked perfectly on 2.7.9 as expected. I
was testing everything by having only one module and doing everything
in site.pp. But, when I moved to the actual environment which includes
2.6.13, it isn't able to find the resource type ucarp::host::config and
complains about invalid resource type. Any idea why that could be
happening?
The situation is something like:
1. There is init.pp in module ucarp containing class ucarp. (As it
should). It has a include "*" written in the first line.
2. There is host.pp in modules/ucarp/manifests which has class
ucarp::host. In that there is a "define config )(args....)".
3. Then in manifests/production/myproject/templates.pp, there are many
classes defined that for each type of host.
4. There is manifests/production/myproject/nodes.pp which has nodes
defined. In that, there is a node A which inherits some class from the
templates.pp.
5. In this node, I did something like:
include ucarp
ucarp::host::config { "ucarp-test":
..
..
}
The puppet complains saying that
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
Invalid resource type ucarp::host
::config at /etc/puppet/manifests/production/myproject/nodes.pp:614 on
node A
I am not sure how to proceed? I have also tried adding "include
ucarp::host" in the node definition but no success.
If the ucarp instances are on different hosts, then it seems to me
that each of those hosts' catalogs should declare only the ucarp
instance for that host. You should not need multiple ucarp
declarations for that setup. Even if you wrote two separate
declarations in your manifest, you would want to use a conditional
statement to ensure that no more than one was actually applied to any
host. Under those circumstances, Puppet would not complain about
duplicate resources.
The code can be seen here
https://github.com/shadyabhi/puppet-ucarp
<https://github.com/shadyabhi/puppet-ucarp>
I have developed two versions, one with classes and the other with
resources. And both suffer the same issue.
If you really do intend to declare two different ucarp instances on
the /same node/, then giving the resources different titles -- such as
"ucarp-test1" and "ucarp-test2" -- should get you around the duplicate
resource issue. (Note: defined-type instances are resources, but
classes are not.)
John
--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/0ZiMgeg52wgJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
--
Cheers,
Abhijeet R
http://blog.abhijeetr.com
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.