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

Enabling AJP not consistent #197

Open
LightAxe opened this issue May 11, 2017 · 3 comments
Open

Enabling AJP not consistent #197

LightAxe opened this issue May 11, 2017 · 3 comments

Comments

@LightAxe
Copy link

It appears that enabling AJP is not consistent between JBoss EAP 6.x and 7.x.

In 6.x, this works:

  class { 'wildfly':
    distribution     => 'jboss-eap',
    init_system      => 'systemd',
    version          => $version,
    install_source   => $install_source,
    java_home        => $java_home,
    dirname          => $dirname,
    java_xmx         => $java_xmx,
    java_xms         => $java_xms,
    java_maxpermsize => $java_maxpermsize,
    java_opts        => "${java_opts} ${gw_java_opts}",
    properties                        => {
      'jboss.bind.address'            => '0.0.0.0',
      'jboss.bind.address.management' => '0.0.0.0',
      'jboss.http.port'               => $public_http_port,
      'jboss.ajp.port'                => '8009',
    },
  }
...
  wildfly::web::connector { 'ajp':
    scheme         => 'http',
    protocol       => 'AJP/1.3',
    socket_binding => 'ajp',
    enable_lookups => false,
    secure         => false,
  }

While in 7.0, the wildfly::web::connector above errors with:

Error: Could not set 'present' on ensure: Failed with: WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "web"),
    ("connector" => "ajp")
] for {"address":[{"subsystem":"web"},{"connector":"ajp"}],"operation":"add","name":"ajp","scheme":"http","protocol":"AJP/1.3","socket-binding":"ajp","enable-lookups":false,"secure":false,"operation-headers":{}} at /etc/puppetlabs/code/environments/production/modules/wildfly/manifests/resource.pp:20
Error: Could not set 'present' on ensure: Failed with: WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "web"),
    ("connector" => "ajp")
] for {"address":[{"subsystem":"web"},{"connector":"ajp"}],"operation":"add","name":"ajp","scheme":"http","protocol":"AJP/1.3","socket-binding":"ajp","enable-lookups":false,"secure":false,"operation-headers":{}} at /etc/puppetlabs/code/environments/production/modules/wildfly/manifests/resource.pp:20
Wrapped exception:
Failed with: WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "web"),
    ("connector" => "ajp")
] for {"address":[{"subsystem":"web"},{"connector":"ajp"}],"operation":"add","name":"ajp","scheme":"http","protocol":"AJP/1.3","socket-binding":"ajp","enable-lookups":false,"secure":false,"operation-headers":{}}
Error: /Stage[main]/Profile::Gwjboss/Wildfly::Web::Connector[ajp]/Wildfly::Resource[/subsystem=web/connector=ajp]/Wildfly_resource[/subsystem=web/connector=ajp]/ensure: change from absent to present failed: Could not set 'present' on ensure: Failed with: WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "web"),
    ("connector" => "ajp")
] for {"address":[{"subsystem":"web"},{"connector":"ajp"}],"operation":"add","name":"ajp","scheme":"http","protocol":"AJP/1.3","socket-binding":"ajp","enable-lookups":false,"secure":false,"operation-headers":{}} at /etc/puppetlabs/code/environments/production/modules/wildfly/manifests/resource.pp:20

and I have to use this instead:

  wildfly::resource { '/subsystem=undertow/server=default-server/ajp-listener=ajp':
    content            => {
      'socket-binding' => 'ajp'
    }
  }

while that code fails with a different set of errors on JBoss 7.x.

I can certainly put those in an if/else block, but I suspect this is a bug somewhere.

Thoughts?

@jairojunior
Copy link
Collaborator

jairojunior commented May 14, 2017

It's normal. JBoss Management Model is constantly evolving and this is documented in this module limitations.

It would be nice if you could provided a PR for a defined type named wildfly::undertow::ajp containing the resource you used for EAP 7.

Regarding the conditional logic, I suggest you move it to your site profiles (Roles & Profiles pattern).

@jairojunior
Copy link
Collaborator

One last thing that I forgot to mention: full-ha profiles already come with AJP configured/enabled - and a lot of other things.

@LightAxe
Copy link
Author

Thanks. We don't want to go full-ha, so will live on with the logic in the profile. I'll submit a PR if I get around to having some free time again...

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

No branches or pull requests

2 participants