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

BREAKING: Change the default 'archive_path' to '/opt/consul/archives'. #292

Merged
merged 1 commit into from
Dec 29, 2016
Merged

BREAKING: Change the default 'archive_path' to '/opt/consul/archives'. #292

merged 1 commit into from
Dec 29, 2016

Conversation

jmkeyes
Copy link
Contributor

@jmkeyes jmkeyes commented Oct 26, 2016

If another Puppet module already defines the archive directory then compiling a catalog leads to a duplicate resource error; this patch should fix that issue.

@solarkennedy
Copy link
Contributor

This is the archive_path, I wouldn't expect people to be managing this outside of this module. Can you tell me more about your use-case and why this path is managed in your environment?

@jmkeyes
Copy link
Contributor Author

jmkeyes commented Oct 27, 2016

This module defines the $archive_path as /opt/puppet-archive by default and manages that directory. That path can also be managed by other modules that use puppet/archive and doesn't seem to be consul-specific. This patch modifies the module to avoid any duplicate resource declarations.

@solarkennedy
Copy link
Contributor

Hmm. You are right, that isn't really a good path for this module to be using.
But I don't think !defines are the way to go.

How about changing the default path to be /opt/consul/ and this module can assume it totally control this dir and doesn't have to share it?

@jmkeyes jmkeyes changed the title Only define File[$install_path] if it isn't already. Change the default 'archive_path' to '/opt/consul'. Nov 18, 2016
@jmkeyes
Copy link
Contributor Author

jmkeyes commented Nov 18, 2016

I've replaced the commit I made with one that updates archive_path to default to /opt/consul as requested. Will that work? Although this seems to work, I'd want to keep downloaded archives in a subfolder of /opt/consul. Maybe /opt/consul/archive or /opt/consul/pkg instead?

@solarkennedy
Copy link
Contributor

Sure, but why do you want to keep downloaded packages in a subfolder of /opt/consul?

@jmkeyes
Copy link
Contributor Author

jmkeyes commented Nov 18, 2016

The primary reason is for maintenance: I want to be able to automatically remove old archives that are no longer used after an installation or upgrade. Currently, the module stores the downloaded archives beside the folders that it extracts them into, which makes slightly harder to see what archives are unused. If the archives are in a separate folder then I can define a tidy resource to clean them up.

@solarkennedy
Copy link
Contributor

sgtm, if we are going to change it, let's change it to something that can be purged automatically. Go ahead and set it to /opt/consul/archive(s) ?

@jmkeyes jmkeyes changed the title Change the default 'archive_path' to '/opt/consul'. Change the default 'archive_path' to '/opt/consul/archives'. Nov 19, 2016
@solarkennedy
Copy link
Contributor

@jmkeyes although now we have a new problem: it is unlikely that users will have /opt/consul ready for puppet to make the archives folder in :( (right?)

@jmkeyes
Copy link
Contributor Author

jmkeyes commented Nov 19, 2016

That is correct.

The examples within the README for this module specify /opt/consul as reasonable default for $::consul::config_hash['data_dir']. This hash key is then used to define $::consul::data_dir within the consul class, which is then used in the consul::install class as a base directory for the extracted archives.

Should I update my patch to store archives under a subdirectory of $::consul::data_dir instead?

@solarkennedy
Copy link
Contributor

Ah, data_dir, right. Yes please. I think this is probably the most direct way to do it, as we know this folder must exist (eventually). 90% of the time that will be /opt/puppet anyway in the base, and then archives under that sounds very sane.

@solarkennedy solarkennedy changed the title Change the default 'archive_path' to '/opt/consul/archives'. BREAKING: Change the default 'archive_path' to '/opt/consul/archives'. Dec 29, 2016
@solarkennedy solarkennedy merged commit 483950f into voxpupuli:master Dec 29, 2016
@jamtur01
Copy link

jamtur01 commented Jan 2, 2017

Looks like this branch was never updated to reflect this: Should I update my patch to store archives under a subdirectory of $::consul::data_dir instead?. See #307.

spuder pushed a commit to spuder/puppet-consul that referenced this pull request Feb 25, 2020
BREAKING: Change the default 'archive_path' to '/opt/consul/archives'.
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