Skip to content

Setting values with spaces is not working (sets every time) #2

Description

@TJM

Using the following puppet code:

    chsec { 'user-default-SYSTEM':
      ensure    => present,
      file      => '/etc/security/user',
      stanza    => 'default',
      attribute => 'SYSTEM',
      value     => 'compat or KRB5LDAP',
      require   => Service['secldapclntd'],
    }

Puppet continually sets the value:

Debug: Executing: '/usr/bin/chsec -f /etc/security/user -s default -a SYSTEM=compat or KRB5LDAP'
Notice: Chsec[user-default-SYSTEM](provider=aix): Changed /etc/security/user default:SYSTEM to compat or KRB5LDAP
Notice: /Stage[main]/Aixldap::Configure/Chsec[user-default-SYSTEM]/ensure: created

Likely due to the following provider code:

if command.split.last.split("=")[1..-1].join('=').strip != resource[:value]

Workaround

    exec { 'chsec-user-default-SYSTEM':
      command => 'chsec -f /etc/security/user -s default -a SYSTEM="compat or KRB5LDAP"',
      onlyif  => 'lssec -f /etc/security/user -s default -a SYSTEM | awk -F= \'{print $2}\' | grep -q "compat or KRB5LDAP"',
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions