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

exec path and environment attributes do not work as documented

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: None
    • Component/s: Docs
    • Labels:
      None
    • Environment:

      CentOS 7, x86_64
      puppet-agent-1.9.0-1 from PC1 repo

    • Template:
    • Epic Link:
    • Team:
      Coremunity
    • QA Risk Assessment:
      Needs Assessment

      Description

      According to https://docs.puppet.com/puppet/latest/type.html#exec-attribute-environment, the environment attribute should override the path attribute if specified. However, attempting to execute the following code:

      exec { 'audit_in_grub2':
          environment => [ 'PATH=/usr/local/sbin:/usr/sbin:/usr/bin' ],
          command     => 'update-grub2-for-audit.sh',
          unless      => "grep 'audit=1' /etc/sysconfig/grub",   # lint:ignore:double_quoted_strings
      }
      

      ...results in the following error:

      Error: Failed to apply catalog: Parameter unless failed on Exec[audit_in_grub2]: 'grep 'audit=1' /etc/sysconfig/grub' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppetlabs/code/environments/KT_tkc_holdings_pnp_production_c7stable_42/modules/audit/manifests/config.pp:13
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jbnance Jason Nance
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support