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

Exec[iptables-aggregate]: '[' is not qualified and no path was specified. #1

Open
jgrammen-agilitypr opened this issue Sep 29, 2022 · 0 comments

Comments

@jgrammen-agilitypr
Copy link

issue with the master branch ( ca206e6 ) when attempting to use snippets

  class { 'iptables':
    use_snippets => true,
  }
  iptables::snippet { '01_common_iptables_rules':
    iptables_content  => epp($ipv4_template_path, { 'ipver' => 'v4' }),
    ip6tables_content => epp($ipv6_template_path, { 'ipver' => 'v6' }),
  }

error:

Error: Parameter onlyif failed on Exec[iptables-aggregate]: '[' is not qualified and no path was specified. Please qualify the command or specify a path. (file: /etc/puppetlabs/code/modules/iptables/manifests/exec.pp, line: 17)

something is off with

    exec { 'iptables-aggregate':
      command => "/bin/cat ${iptables::snippet_dir}/*.v4 > ${iptables::iptables_aggregated_file}",
      umask   => '0077',
      # only if missing/empty aggregated file or if aggregated file is older than snippet dir
      onlyif  => "[ ! -s '${iptables::iptables_aggregated_file}' ] || [ '${iptables::iptables_aggregated_file}' -ot '${iptables::snippet_dir}' ]",
    }

it appears that the bash test that is occurring in the onlyif does not work properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant