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

puppet-agent : Concat not respecting environments

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • PUP 7.10.0
    • PUP 6.25.0, PUP 7.12.0
    • None
    • Night's Watch
    • 2
    • NW - 2021-10-06
    • Needs Assessment
    • Bug Fix
    • Fix a bug where the ENC-specified environment would not get pushed on the context during the agent run, causing indirector requests (such as file metadata requests) that didn't specify an environment to default to an incorrect one.
    • Needs Assessment

    Description

      Basic Info
      Module Version: puppetlabs-concat 7.1.1
      Puppet Version: 7.10.0
      OS Name/Version: Centos 7

      Describe your issue in as much detail as possible...
      Concat is not respecting the choosen environment via external enc when fetching module content for files.

      Error:

      Error: /Stage[main]/Df_modsec::Config/Concat[/etc/nginx/modsecurity_main.conf]/Concat_file[/etc/nginx/modsecurity_main.conf]: Failed to generate additional resources using 'eval_generate': Could not retrieve 
      source(s) puppet:///modules/df_modsec/modsecurity_main.conf
      

      Code:

       -> concat { $df_modsec::config_main:
          ensure => 'present',
          owner  => 0,
          group  => 0,
          mode   => '0644',
          order  => 'numeric',
          notify => Class['::df_web::nginx::service'],
        }
        -> concat::fragment { $df_modsec::config_main:
          order  => 0,
          target => $df_modsec::config_main,
          source => 'puppet:///modules/df_modsec/modsecurity_main.conf',
          notify => Class['::df_web::nginx::service'],
        }
      

      After further inspection of the run with the --debug parameter it is visible that puppet switched back to the default environment "production" during the run. The file itself is managed in a different environment.

      [root@somehost0 ~]# puppet agent -tv  --noop --debug 
      Info: Using environment 'customer1_production'
      ...
      Debug: Using cached connection for https://puppet.int.hostname.net:8140
      Debug: HTTP GET https://puppet.int.hostname.net:8140/puppet/v3/file_metadata/modules/df_varnish/backend.vcl?*environment=production* returned 404 Not Found
      

      backend.vcl?environment=production should be customer1_production if i am not mistaken by the logic.

      Desired Behavior:
      Run resulting no error

      Actual Behavior:
      Run unable to fetch files via concat.

      Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

      Can provide further logs if needed, just let me know.
      Thanks for your time

      Attachments

        Activity

          People

            gabriel.nagy Gabriel Nagy
            Betriebsrat Sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support