-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the relationship metaparameter #9
base: master
Are you sure you want to change the base?
Conversation
Puppet ordering is not deterministic thus requiring us to explicitly set the relationship between resources. In this case, we need the curl command to "require" the file already be created before downloading contents into it. It will still work without this because it frankly doesn't matter if the file resource is called before or after the curl command is run.
We should be able to merge #8 now. 👍 |
@@ -27,10 +30,16 @@ | |||
$valid_ensures = [ 'absent', 'present', 'latest' ] | |||
validate_re($ensure, $valid_ensures) | |||
|
|||
file { $name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a duplicate resource error when ensure=absent
, due to the code block below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah missed that, thanks. So how about we move the new file resource at line 33 inside the else?
Like this:
...
} else {
file { $name:
owner => $owner,
group => $group,
mode => $mode,
}
$real_source = "https://${s3_domain}/${source}"
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that'll work
Moving file resource inside the else to remove the duplicate declaration when ```ensure => absent``` is used
Updated. Also wondered if I should add sensible default values for owner, group, and mode since these are not technically required for a file resource. |
Any chance of getting this merged? |
To avoid weird race conditions or other weird behavior, I added the require metaparameter to require that the file be created before curl is executed.