I have been able to reproduce this issue using the Vagrant test box: https://github.com/davidl-zend/zendserverpuppet-vagrant. I followed the set up instructions in the README, with the additional step that I modified manifests/site.pp for the test box to the following:
On the first vagrant up, you can see in the output that the API hash $::zend_api_key_hash is not available even after Zend Server has bootstrapped. (this is the notice created in manifests/init.pp which requires Class['zendserver::bootstrap'])
==> debianbox: Notice: zendserversetup hash
==> debianbox: Notice: /Stage[main]/Zendserver/Notify[zendserversetup hash ]/message: defined 'message' as 'zendserversetup hash '
If you run a subsequent vagrant reload --provision, then the fact file has already been created before the manifest is applied, so the hash is loaded correctly:
==> debianbox: Notice: zendserversetup hash cc8076657313ade468b98f84670a2108e2fe3aa7bd81a893e59801fc0bbdd65b
==> debianbox: Notice: /Stage[main]/Zendserver/Notify[zendserversetup hash cc8076657313ade468b98f84670a2108e2fe3aa7bd81a893e59801fc0bbdd65b]/message: defined 'message' as 'zendserversetup hash cc8076657313ade468b98f84670a2108e2fe3aa7bd81a893e59801fc0bbdd65b'
I'm very new to Puppet, so I don't know what the origin of the issue is. I know that Puppet loads facts before applying a manifest, but is it "refreshed" during an apply so that it can find facts created during the run? Ideally it should be recognized immediately after the fact file is created so that in other parts of the manifest you can use it to interact with zs-manage, for example.
I have been able to reproduce this issue using the Vagrant test box: https://github.com/davidl-zend/zendserverpuppet-vagrant. I followed the set up instructions in the README, with the additional step that I modified
manifests/site.pp
for the test box to the following:On the first
vagrant up
, you can see in the output that the API hash$::zend_api_key_hash
is not available even after Zend Server has bootstrapped. (this is the notice created inmanifests/init.pp
which requiresClass['zendserver::bootstrap']
)If you run a subsequent
vagrant reload --provision
, then the fact file has already been created before the manifest is applied, so the hash is loaded correctly:I'm very new to Puppet, so I don't know what the origin of the issue is. I know that Puppet loads facts before applying a manifest, but is it "refreshed" during an apply so that it can find facts created during the run? Ideally it should be recognized immediately after the fact file is created so that in other parts of the manifest you can use it to interact with
zs-manage
, for example.