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

order parameter contains invalid characters #70

Closed
saz opened this issue May 24, 2015 · 3 comments
Closed

order parameter contains invalid characters #70

saz opened this issue May 24, 2015 · 3 comments

Comments

@saz
Copy link
Sponsor Contributor

saz commented May 24, 2015

I'm receiving the following error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Order cannot contain '/', ':', or '
'. at /etc/puppet/repo/modules/concat/manifests/fragment.pp:46 on node lvs1.example.com

There are invalid characters in the order parameter due to the naming of my virtual servers (for example r-mq-c1:5672) and the following part of keepalived::lvs::virtual_server

concat::fragment { "keepalived.conf_lvs_virtual_server_${name}":
    target  => "${::keepalived::config_dir}/keepalived.conf",
    content => template('keepalived/lvs_virtual_server.erb'),
    order   => "250-${name}-000",
  }

or the following part from keepalived::lvs::real_server

concat::fragment { "keepalived.conf_lvs_real_server_${name}":
    target  => "${::keepalived::config_dir}/keepalived.conf",
    content => template('keepalived/lvs_real_server.erb'),
    order   => "250-${virtual_server}-${name}",
  }

I think, it would be the best to remove invalid characters from $name: fail("Order cannot contain '/', ':', or '\n'.")

Module version: 1.1.1
Concat module version: 1.2.2 (it's the same for 2.0.0)

@arioch
Copy link
Contributor

arioch commented May 28, 2015

Hm tricky to fix this in a clean way as Puppet doesn't allow to reassign variables.

F.i. this doesn't work:

$name = regsubst($name, ':',  '')
$name = regsubst($name, '\/', '')
$name = regsubst($name, '\n', '')

While this does work it's not very elegant.:

$_name = regsubst($name, ':',  '')
$__name = regsubst($_name, '\/', '')
$___name = regsubst($__name, '\n', '')

Is this a hard requirement for you to have those characters replaced?
If it's not I'd prefer using validate_re($name, ...) instead.

@saz
Copy link
Sponsor Contributor Author

saz commented May 28, 2015

This would require a massive change of my manifests and hiera files and I'm quite sure, other people are also running into this issue

Shouldn't $_name = regsubst($name, '[:\/\n]', '') be doing the same in one step? (not quite sure about the line break (\n) if the backslash needs to be escaped or not).

@arioch
Copy link
Contributor

arioch commented May 28, 2015

I don't have the means to test it myself right now.
Could you check 5720e4a and see if it works for you? If it does I'll merge it to master.

@arioch arioch closed this as completed Aug 4, 2015
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

2 participants