Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mlehner616
Copy link

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.

marshyski and others added 3 commits April 16, 2014 18:07
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.
@mlehner616
Copy link
Author

We should be able to merge #8 now. 👍

@@ -27,10 +30,16 @@
$valid_ensures = [ 'absent', 'present', 'latest' ]
validate_re($ensure, $valid_ensures)

file { $name:
Copy link
Owner

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.

Copy link
Author

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}"
  ...
}

Copy link
Owner

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
@mlehner616
Copy link
Author

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.

@mlehner616
Copy link
Author

Any chance of getting this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants