Skip to content

Adding the relationship metaparameter#9

Open
mlehner616 wants to merge 5 commits into
branan:masterfrom
mlehner616:master
Open

Adding the relationship metaparameter#9
mlehner616 wants to merge 5 commits into
branan:masterfrom
mlehner616:master

Conversation

@mlehner616
Copy link
Copy Markdown

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.

Tim Ski 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
Copy Markdown
Author

We should be able to merge #8 now. 👍

Comment thread manifests/init.pp Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants