Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Add a params.pp file #59

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/extract.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$tar_command=$::archive::params::tarcmd,
) {

include ::archive::params
require ::archive::params
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no resources in params, so include will do just the same as require.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure about that one. Does an include enforce order of evaluation?

the require ensures ::archive::params is evaluated before the extract.pp is evaluated, so that the
values of ::archive::params::FOOBAR are available, when used later in the defined type, does the
include enforce the same?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're mixing up order of parsing and order of evaluation.

Parsing is done on the master side, always top-down.

Evaluation is done on the agent, based on the catalog, and following the dependency tree based on either implicit or explicit dependencies between resources.

The params class has no resources at all, only variables, so there's no need for evaluation ordering. Variables will be available if they have been parsed before, which is true if you included the class already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, really. include is all you need. If it fails, it must be another reason.


if $root_dir {
$extract_dir = "${target}/${root_dir}"
Expand Down