Dependency/Ordering two create_resources statements

asked 2017-03-06 09:11:02 -0500

bschonecker gravatar image

updated 2017-03-06 09:21:23 -0500

I have some RPM packages that need to be installed on my Linux servers. However, there are som RPM/GPG keys that need to go on first. I have both GPG keys and RPM packages in hiera but I don't know how to set up the ordering when I use create_resource()

$rpmkeys = hiera_hash('rpmkeys')
create_resources('rpmkey', $rpmkeys)
$required_packages = hiera_array('required_packages')
create_resources('package', $required_packages)

I've tried putting a require in the Package create_resources() statement but puppet gives me errors:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error creating type specialization of a Rpmkey-Type, Cannot use Hash[String, Hash[String, String]] where a resource title String is expected at /etc/puppetlabs/code/modules/profiles/manifests/base.pp:99:33 on node","issuekind":"RUNTIMEERROR"} Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Is there a way to specify that ALL rpmkeys are processed before ANY Package resource?

edit retag flag offensive close merge delete