Only Variable String


Variables standing by themselves should not be quoted. To put it another way, strings should not contain just a single variable (style guide).

What you have done

  file { '/tmp/foo':
    owner => "${file_owner}",
  }

What you should have done:

  file { '/tmp/foo':
    owner => $file_owner,
  }

Disabling the check

To disable this check you can add --no-only_variable_string-check to your puppet-lint command line.

$ puppet-lint --no-only_variable_string-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_only_variable_string')