Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter incorrectly detecting command statement #41

Open
maxadamo opened this issue Mar 23, 2023 · 0 comments
Open

linter incorrectly detecting command statement #41

maxadamo opened this issue Mar 23, 2023 · 0 comments
Labels
bug Something isn't working community

Comments

@maxadamo
Copy link

Describe the Bug

I have a cron resource, and the linter is detecting the parameter minute as a command statement, and it's reporting an unsafe interpolation.

Expected Behavior

Detect proper statements within the resource, and throw warning whereas necessary.

Steps to Reproduce

I have the following code:

  cron {
    default:
      user        => 'root',
      hour        => '*',
      month       => '*',
      monthday    => '*',
      weekday     => '*',
      environment => 'STARTED_BY_CRON=yes';
    # ensure that the VXLANs are up and running (ideally this should be done by systemd)
    'keep-vxlan-up':
      ensure  => $cron_ensure_status,
      command => 'flock /tmp/vxlan-configurator /usr/local/bin/vxlan-configurator.sh --status up --name all',
      minute  => "*/${$keep_vxlan_up_cron_interval}";
    # it unconfigures the VXLANs that are not in use and disable corresponding systemd services
    # it's also triggered when the directory /etc/vxlan/{multicast,unicast}.d is changed
    'purge_unused_vxlans':
      ensure  => present,
      command => 'flock /tmp/vxlan-configurator /usr/local/bin/vxlan-configurator.sh --purge',
      minute  => fqdn_rand(59);
  }

and the linter is throwing the following error:

./manifests/config.pp - WARNING: unsafe interpolation of variable 'keep_vxlan_up_cron_interval' in exec command on line 118 (check: check_unsafe_interpolations)

Environment

  • Linter plugin version: 0.0.4
  • Puppet Version: 7.xx
  • Platform Ubuntu 20.04
@maxadamo maxadamo added the bug Something isn't working label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

No branches or pull requests

2 participants