You should not intermingle conditionals with resource declarations. When using
conditionals for data assignment, you should separate conditional code from the
resource declarations (style guide).
What you have done
What you should have done:
Disabling the check
To disable this check you can add --no-selector_inside_resource-check to your
puppet-lint command line.
Alternatively, if you’re calling puppet-lint via the Rake task, you should
insert the following line to your Rakefile.