Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1765

puppet apply --modulepath not respected when /etc/puppet/environments/production exists

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 3.5.0
    • Fix Version/s: PUP 3.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      puppet-3.4.3.919-1.el6.noarch

    • Template:
    • Story Points:
      2
    • Sprint:
      Week 2014-2-19 to 2014-2-26, Week 2014-2-26 to 2014-3-5, Week 2014-3-05 to 2014-3-12

      Description

      This appears to be a strange condition since the new directory environments work went in. When /etc/puppet/environments/production exists, puppet apply stops obeying --modulepath and instead attempts to look up the module in /etc only. For example:

      # mkdir /etc/puppet/environments/production
      # puppet module install -i /tmp/test saz/ntp
      Notice: Preparing to install into /tmp/test ...
      Notice: Created target directory /tmp/test
      Notice: Downloading from https://forge.puppetlabs.com ...
      Notice: Installing -- do not interrupt ...
      /tmp/test
      └── saz-ntp (v2.2.0)
      # puppet apply --modulepath /tmp/test -e 'include ntp' --noop
      Error: Could not find class ntp for foreman-el6.example.com on node foreman-el6.example.com
      Error: Could not find class ntp for foreman-el6.example.com on node foreman-el6.example.com
      # cp -a /tmp/test/ntp /etc/puppet/environments/production/modules/
      # puppet apply --modulepath /tmp/test -e 'include ntp' --noop
      Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
      Notice: Compiled catalog for foreman-el6.example.com in environment production in 0.53 seconds
      Notice: /Stage[main]/Ntp/Package[ntp]/ensure: current_value absent, should be present (noop)
      ^CExiting
      

      But if I remove that directory:

      # rm -rf /etc/puppet/environments/production/
      # ll /etc/puppet/environments
      total 0
      # puppet apply --modulepath /tmp/test -e 'include ntp' --noop
      Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
      Notice: Compiled catalog for foreman-el6.example.com in environment production in 0.53 seconds
      Notice: /Stage[main]/Ntp/Package[ntp]/ensure: current_value absent, should be present (noop)
      ^CExiting
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                domcleal Dominic Cleal
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support