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

(MODULES-2756) Adding include ::apache so mkdir exec works properly #1236

Merged
merged 1 commit into from Feb 18, 2016

Conversation

damonconway
Copy link
Contributor

This fixes a compile error where the require on Exec["mkdir ${::apache::mod_dir}"] was failing because it couldn't resolve ${::apache::mod_dir}.

@@ -12,6 +12,7 @@
'Ratio' => 'ratio'
}
) {
include ::apache
::apache::mod { 'deflate': }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm confused.
shouldn't that line ^ error out, and tell you to first include apache before including any modules?
see: https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/mod.pp#L11-L13

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused as well. It did not error out there. The error I got is
documented in the ticket.

"Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Invalid relationship: File[deflate.conf] { require => Exec[mkdir ] },
because Exec[mkdir ] doesn't seem to be in the catalog"

Even though in my profile::apache I have "include ::apache" already, and my
"profile::apache::cfg::ontrack" uses $::apache::httpd_dir just fine and is
where I do a "include ::apache::mod::deflate".

I came to the include ::apache solution from MODULES-1491.

It seems as if puppet is not correctly resolving the catalog. The other
solution I can think of is to include ::apache in
profile::apache::cfg::ontrack and use anchors to make sure the apache class
loads before apache::mod::deflate. Seems like a lot of work for the end
user when this should just work.

Thanks,
Damon

On Thu, Oct 29, 2015 at 8:45 AM, Igor Galić notifications@github.com
wrote:

In manifests/mod/deflate.pp
#1236 (comment)
:

@@ -12,6 +12,7 @@
'Ratio' => 'ratio'
}
) {

  • include ::apache
    ::apache::mod { 'deflate': }

i'm confused.
shouldn't that line ^ error out, and tell you to first include apache
before including any modules?
see:
https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/mod.pp#L11-L13


Reply to this email directly or view it on GitHub
https://github.com/puppetlabs/puppetlabs-apache/pull/1236/files#r43402520
.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to say that I attached the files for profile::apache and
profile::apache::cfg::ontrack to the last email.

Damon

On Thu, Oct 29, 2015 at 3:14 PM, Damon Conway vstraylight@gmail.com wrote:

I was confused as well. It did not error out there. The error I got is
documented in the ticket.

"Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Invalid relationship: File[deflate.conf] { require => Exec[mkdir
] }, because Exec[mkdir ] doesn't seem to be in the catalog"

Even though in my profile::apache I have "include ::apache" already, and
my "profile::apache::cfg::ontrack" uses $::apache::httpd_dir just fine and
is where I do a "include ::apache::mod::deflate".

I came to the include ::apache solution from MODULES-1491.

It seems as if puppet is not correctly resolving the catalog. The other
solution I can think of is to include ::apache in
profile::apache::cfg::ontrack and use anchors to make sure the apache class
loads before apache::mod::deflate. Seems like a lot of work for the end
user when this should just work.

Thanks,
Damon

On Thu, Oct 29, 2015 at 8:45 AM, Igor Galić notifications@github.com
wrote:

In manifests/mod/deflate.pp
#1236 (comment)
:

@@ -12,6 +12,7 @@
'Ratio' => 'ratio'
}
) {

  • include ::apache
    ::apache::mod { 'deflate': }

i'm confused.
shouldn't that line ^ error out, and tell you to first include apache
before including any modules?
see:
https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/mod.pp#L11-L13


Reply to this email directly or view it on GitHub
https://github.com/puppetlabs/puppetlabs-apache/pull/1236/files#r43402520
.

@igalic
Copy link
Contributor

igalic commented Oct 30, 2015

@damonconway i don't think github copies attatchments from emails into comments…

@damonconway
Copy link
Contributor Author

Ok, I'll attach them here in the web interface....or not. Github won't let me attach them. I've attached them to the ticket.

Thanks,
Damon

@bmjen
Copy link
Contributor

bmjen commented Dec 18, 2015

@damonconway I'm not sure why this is necessary. Typically when using/declaring an apache mod, the apache class is also declared, like this:

class { 'apache': }
class { 'apache::mod::deflate': }

It has never been a pattern in our mods to allow them to include or instantiate an apache class. Perhaps I'm not understanding the usecase?

@igalic any thoughts on the need or usecase described here?

@DavidS
Copy link
Contributor

DavidS commented Jan 7, 2016

mod_deflate is also managed by apache::default_mods, so that may muddy the waters here.

@damonconway @igalic I'd be really grateful for revisiting this.

@damonconway
Copy link
Contributor Author

In the ticket, I attached my profile classes so you can see how I'm calling
it. In profile::apache, I call "include ::apache". From
profile::apache::cfg::ontrack, I call "include ::profile::mod::deflate". In
my role::web class, I call "include ::profile::apache". I include
profile::apache::cfg::ontrack in a classes array in hiera.

I don't think it's a good plan to include apache in apache::mod::deflate,
but that's the only way I got it to work. Putting it in
::profile::apache::cfg::ontrack did not work.

https://tickets.puppetlabs.com/browse/MODULES-2756

The require that's failing is 'require => Exec["mkdir ${::apache::mod_dir}"],'.
For some reason, it cannot resolve ::apache::mod_dir until I put "include
::apache" into ::apache::mod::deflate.

Please see https://tickets.puppetlabs.com/browse/MODULES-1491 for another
example of this problem.

Damon

On Thu, Jan 7, 2016 at 8:51 AM, David Schmitt notifications@github.com
wrote:

mod_deflate is also managed by apache::default_mods, so that may muddy
the waters here.

@damonconway https://github.com/damonconway @igalic
https://github.com/igalic I'd be really grateful for revisiting this.


Reply to this email directly or view it on GitHub
#1236 (comment)
.

@tphoney
Copy link
Contributor

tphoney commented Feb 18, 2016

I am actively looking into this.

@tphoney
Copy link
Contributor

tphoney commented Feb 18, 2016

So this seems to be endemic throughout the mod classes. I am working on adding tests to show this, and add the appropriate fixes.

Thanks for pointing this out.

tphoney added a commit that referenced this pull request Feb 18, 2016
(MODULES-2756) Adding include ::apache so mkdir exec works properly
@tphoney tphoney merged commit c091b17 into puppetlabs:master Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants