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

Can't add multiple Listen entries #8

Open
skrussell opened this issue Jul 13, 2018 · 2 comments
Open

Can't add multiple Listen entries #8

skrussell opened this issue Jul 13, 2018 · 2 comments

Comments

@skrussell
Copy link

skrussell commented Jul 13, 2018

We have a need to add multiple specific "Listen" directives in the httpd.conf file, but I don't seem to be able to.

The following code:

$profile::bind_addresses.each |Integer $index, Stdlib::IP::Address $ip_addr| {
  apache_directive { "set_apache_listen_address_${index}":
    ensure => 'present',
    name   => 'Listen',
    args   => "${ip_addr}:80"
  }   
}

simply results in:

Cannot alias Apache_directive[set_apache_listen_address_1] to [nil, "Listen", nil] at (file: /etc/puppetlabs/code/environments/rk_test/site/apache/manifests/init.pp, line: 56); resource ["Apache_directive", nil, "Listen", nil] already declared (file: /etc/puppetlabs/code/environments/rk_test/site/apache/manifests/init.pp, line: 56)

I know this is probably a small use case, but having multiple Listen directives is valid syntax in Apache, so I'm filing this issue report as I think this needs a fix.

@raphink
Copy link
Member

raphink commented Jul 17, 2018

Indeed, that doesn't seem doable at the moment. I'm not sure how to make this possible really. What kind of syntax would you expect to use to tell Puppet that it needs to manage several Listen parameters instead of overriding?

@trevor-vaughan
Copy link
Contributor

@raphink Probably have to use a composite namevar for that.

Listen <ipaddr>:80 or the like.

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

3 participants