rhtconsulting / puppet-jboss_admin

Puppet module for runtime configuration of a JBoss container
MIT License
15 stars 12 forks source link

cli_execution.rb format_value() needs to handle values with double qutoes #99

Closed itewk closed 8 years ago

itewk commented 8 years ago

Currently the following will not work:

  jboss_batch { 'Service Audit Log':
    server => standalone,
    batch  => [
      { 'address' => '/subsystem=logging/periodic-rotating-file-handler=SERVICE_AUDIT',
        'options' => {
          'filter-spec' => "any(match(\"JBAS015874\"),match(\"JBAS015950\"),match(\"JBAS015859\"),match(\"JBAS015858\"))",
          'append'      => true,
          'file'        => {
            'relative-to' => 'jboss.server.log.dir',
            'path'        => 'service_audit.log'
          },
          'suffix'      => '.yyyy-MM-dd'
        }
      },
    ],
    unless => '(result < "6.2.0.GA") of :read-attribute(name=product-version)',
  }

You end up with a message along the lines of the following:

Jboss_batch[Service Audit Log]: Could not evaluate: Error executing CLI batch `Service Audit Log`: The closing '"' is missing.

Trying other methods for escaping the double quotes causes idempotency issues. Because of a miss-match between Puppet quote escaping and CLI quote escaping.

There needs to be a solution which solves this problem and is idempotent.

itewk commented 8 years ago

merged into master