librarian-puppet icon indicating copy to clipboard operation
librarian-puppet copied to clipboard

puppet module tool needs to use '--force' on PE >= 3.2.1

Open curator opened this issue 10 years ago • 5 comments

Per https://github.com/rodjek/librarian-puppet/pull/190, in order to get around a 'supported modules' issue where the puppet module tool will fail install if you attempt to use a module 'supported' by that particular version of PE (such as using a newer stdlib, a common practice), the invocation needs to use '--force' instead of '--ignore-dependencies'.

curator avatar Apr 15 '14 21:04 curator

For what I see here http://docs.puppetlabs.com/references/3.4.3/man/module.html --ignore-dependencies is still needed as force will install the dependencies, isn't it?

carlossg avatar Apr 16 '14 08:04 carlossg

The --ignore-dependencies flag is insufficient to resolve this problem. One of either --force or --ignore-requirements needs to be specified to bypass the 'supported' check.

Note that the --ignore-requirements flag is an addition, and so won't work with older versions of Puppet.

The behavior is demonstrated below with each flag.

[root@master ~]# puppet --version
3.4.3 (Puppet Enterprise 3.2.3)
[root@master ~]# puppet module --modulepath /tmp install puppetlabs/firewall --version 1.0.0 --ignore-dependencies
Notice: Preparing to install into /tmp ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Found at least one version of puppetlabs-firewall compatible with PE (3.2.3);
Notice: Skipping versions which don't express PE compatibility. To install
the most recent version of the module regardless of compatibility
with PE, use the '--ignore-requirements' flag.
Error: Could not install 'puppetlabs-firewall' (v1.0.0)
  No releases matching '1.0.0' are available from https://forgeapi.puppetlabs.com
[root@master ~]# puppet module --modulepath /tmp install puppetlabs/firewall --version 1.0.0 --ignore-requirements
Notice: Preparing to install into /tmp ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/tmp
└── puppetlabs-firewall (v1.0.0)
[root@master ~]# puppet module --modulepath /tmp install puppetlabs/firewall --version 1.0.0 --force
Notice: Preparing to install into /tmp ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/tmp
└── puppetlabs-firewall (v1.0.0)

reidmv avatar May 29 '14 18:05 reidmv

@reidmv yes, --ignore-dependencies is not enough, but is it still needed? firewall is not a good example as it does not have dependencies

Give it a try with the mysql module to see if dependency stdlib is installed (clean tmp between calls)

puppet module --modulepath /tmp install puppetlabs/mysql --version 2.2.3 --ignore-requirements
puppet module --modulepath /tmp install puppetlabs/mysql --version 2.2.3 --force
puppet module --modulepath /tmp install puppetlabs/mysql --version 2.2.3 --ignore-requirements --ignore-dependencies
puppet module --modulepath /tmp install puppetlabs/mysql --version 2.2.3 --force --ignore-dependencies

carlossg avatar May 29 '14 18:05 carlossg

I have confirmed that this will definitely work with --force and co-exists with --ignore-dependencies and also replaces it (only the first of your four examples get stdlib installed, the rest successfully ignore all the things requested).

screen shot 2014-10-07 at 2 05 02 pm

I do, however, note that code paths have changed sufficiently to make my original pull request useless. Would you like me to kill and resubmit or is there enough data to move forward with the change yourself?

curator avatar Oct 07 '14 21:10 curator

Please rebase and you can update the branch with "git push -f" and will update the issue

carlossg avatar Oct 08 '14 12:10 carlossg