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

This allows an override of the default DirectoryIndex directive #211

Merged
merged 7 commits into from
Jun 10, 2013

Conversation

Aethylred
Copy link
Contributor

Currently the DirectoryIndex directive is set globally usingthe dir.conf.erb template. This PR allows the default inclusive DirectoryIndex string to be changed.

Should we consider adding a DirectoryIndex override on apache::vhost?

@@ -1 +1,5 @@
<% if @indexes and @indexex != '' -%>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a typo, @indexex.

Could you please have the template simply contain DirectoryIndex <%= @indexes.join(' ') %> since we can enforce constraints and defaults in the manifest instead?

@hunner
Copy link
Contributor

hunner commented Jun 5, 2013

Thanks for all of your submissions @Aethylred! If you could start the rspec-puppet coverage for the apache::mod::dir` class then that would be awesome! But I understand if not.

@Aethylred
Copy link
Contributor Author

I've broken and fixed the spec tests for the default case :) ...now I just need to remember how to pass parameters for spec tests.

@hunner
Copy link
Contributor

hunner commented Jun 6, 2013

Actually the tests failing was correct, as the apache::mod::dir class is already declared in the apache::default_mods class and redeclaring it with parameters is a duplicate class declaration. This is kind of a problem because copy/pasting the apache::default_mods content isn't a great way to go, but I haven't come up with a better way to allow apache mod conditional loading without array subtraction.

@Aethylred
Copy link
Contributor Author

I was suspecting something like that, Puppet being a declarative language and all. Each class declared only once.

...do you have a link to an example showing a working pattern for testing parametrised classes?

@Aethylred Aethylred closed this Jun 6, 2013
@Aethylred Aethylred reopened this Jun 6, 2013
@hunner
Copy link
Contributor

hunner commented Jun 7, 2013

@Aethylred Your pattern is actually working! The tests are just failing because of the way apache::default_mods is written and will continue to fail until I can figure out how to conditionally exclude specific classes (like apache::mod::dir) from apache::default_mods.

Otherwise https://github.com/puppetlabs/puppetlabs-apache/blob/master/spec/classes/apache_spec.rb#L220 is probably a good example of multiple different parameters, including verifying one value that raises a Puppet::ParseError

@hunner
Copy link
Contributor

hunner commented Jun 7, 2013

If you're asking about how to make this work now, that would require setting a different :pre_condition for the context. Something like this:

      let :pre_condition do
        'class { "apache":
          default_mods => false,
        }'
      end

@hunner
Copy link
Contributor

hunner commented Jun 7, 2013

Oh, also if you could clean up your git history to be functionally descriptive before merging, that would be awesome :).

Aaron Hicks added 2 commits June 7, 2013 13:31
… in the template, and move logic from template to class.
Note: No package test as it seems mod_dir is distributed _with_ the Apache package.
@Aethylred
Copy link
Contributor Author

ugh, dragged in some commits from master.

@Aethylred
Copy link
Contributor Author

Bother, now that I have learned this. It will be expected of me.

@hunner
Copy link
Contributor

hunner commented Jun 7, 2013

Haha! :)

hunner added a commit that referenced this pull request Jun 10, 2013
This allows an override of the default DirectoryIndex directive
@hunner hunner merged commit 89da129 into puppetlabs:master Jun 10, 2013
@Aethylred Aethylred deleted the directoryindex branch June 10, 2013 23:18
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.

3 participants