Search code examples
puppetaugeas

unable to print augeas for own configuration


I have below dtp.conf file for internal requirement.

/opt/dtp/etc/dtp.conf

export CHO='NON-PROD'

but when I print the config file via augtool unable to print the value

/opt/pupet/bin/augtool
augtool> print /files/opt/dtp/etc/dtp_config
augtool>

Solution

  • I do not remember Augeas having a specific lens for this file. Augeas cannot guess which lens (parser) to use, it needs to know which lens to associate to which file.

    In this case, this looks like a Shellvar type of file, so you can use e.g.:

    augtool -At "Shellvars.lns incl /opt/dtp/etc/dtp.conf"
    

    to edit it.

    In Puppet, use the shellvar type from the augeasproviders_shellvar Puppet module:

    shellvar { 'CHO':
      ensure => exported,
      target => '/opt/dtp/etc/dtp_config',
      value  => 'NON-PROD',
    }