Giter Club home page Giter Club logo

Comments (8)

hernan82arg avatar hernan82arg commented on May 21, 2024

I have the same issue in Ubuntu 14.04, tried to override and still wants to install tomcat6 instead of 7.

from tomcat.

alanivey avatar alanivey commented on May 21, 2024

This cookbook does not appear to be "role/wrapper cookbook"-friendly. In my testing, I had to eschew my wrapper cookbook methodology only for Tomcat and instead set the version in my environment attributes file for Chef Zero. It's enough to make me consider writing my own super-basic Tomcat cookbook, unfortunately.

EDIT: The workaround is to re-declare every attribute that is dependent on the one you changed. For example, in change base_version from 6 to 7 in a wrapper cookbook:

### Changed value(s):
default['tomcat']['base_version'] = '7'

### Unchanged values that rely on above being different:
suffix = node['tomcat']['base_version'].to_i < 7 ? node['tomcat']['base_version'] : ''
default['tomcat']['base_instance'] = "tomcat#{suffix}"
default['tomcat']['home'] = "/usr/share/tomcat#{suffix}"
default['tomcat']['base'] = "/usr/share/tomcat#{suffix}"
default['tomcat']['config_dir'] = "/etc/tomcat#{suffix}"
default['tomcat']['log_dir'] = "/var/log/tomcat#{suffix}"
default['tomcat']['tmp_dir'] = "/var/cache/tomcat#{suffix}/temp"
default['tomcat']['work_dir'] = "/var/cache/tomcat#{suffix}/work"
default['tomcat']['context_dir'] = "#{node['tomcat']['config_dir']}/Catalina/localhost"
default['tomcat']['webapp_dir'] = "/var/lib/tomcat#{suffix}/webapps"
default['tomcat']['lib_dir'] = "#{node['tomcat']['home']}/lib"
default['tomcat']['endorsed_dir'] = "#{node['tomcat']['lib_dir']}/endorsed"
default['tomcat']['packages'] = ["tomcat#{suffix}"]
default['tomcat']['deploy_manager_packages'] = ["tomcat#{suffix}-admin-webapps"]

from tomcat.

gsaslis avatar gsaslis commented on May 21, 2024

This sounds to me like an issue with the attribute precedence... It sounds like it could be resolved by setting your attribute in the wrapper cookbook with a higher precedence??

Could you try using normal or override instead of default ?
You can find more info on this here

from tomcat.

hernan82arg avatar hernan82arg commented on May 21, 2024

I did try the override. It just doesn't work :S I end up writing my own :)
Thanks!

from tomcat.

gsaslis avatar gsaslis commented on May 21, 2024

:)
I remember I was also struggling back when I first tried to use this (and other) cookbooks, but I can't say for sure what I'd tried...
It's now working for me with the override in an environment.
Not sure if that's suitable for your scenario?

EDIT:
p.s. this looks like a dup of #129 ?

from tomcat.

gsaslis avatar gsaslis commented on May 21, 2024

digging a little further into the issues, I see that this very same issue also appears in #102 - and it's actually very well documented there .

The problem / solutions are explained perfectly in this article.

I would argue there's not much we can do apart from clearly documenting this in the README.md , so that ppl know to use a role / environment vs. overriding the attributes (e.g. if you override base_version, which seems to be the most common case, you should make sure to override all the others deriving from it).

another option could be to replace usages of the derived attributes where we read the value, with:

  • inlined value (i.e. instead node['tomcat']['config_dir'], use sth like "/etc/tomcat#{node['tomcat']['base_version']}")
  • a function that contains the logic, so it would compute the value every time

EDIT:
dup of #89 as well !!

from tomcat.

tas50 avatar tas50 commented on May 21, 2024

First off I'm very sorry that it's taken so long to get back to you on this issue. For a significant period of time there was no active Chef Software Inc. maintainer for this repository and things languished. We're now actively maintaining this cookbook again, and as part of that I've rewritten the cookbook with new custom resources for installing Tomcat from Apache Org sources. This will ship in an upcoming 2.0 release and then we'll remove the existing recipes and providers in a future 3.X release. With those new providers I believe the need for this change goes away so I'm going to close this out. I encourage you to give the new providers a try and let me know if we can tackle more Tomcat management without the attributes bloat the current code suffers from. They're on the master branch and once the documentation and testing improves a bit they'll be released as a 2.0 cookbook.

from tomcat.

lock avatar lock commented on May 21, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from tomcat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.