puppetmodule icon indicating copy to clipboard operation
puppetmodule copied to clipboard

Feature nginx

Open bastelfreak opened this issue 11 years ago • 31 comments

add basic nginx/unicorn support. nginx vhost is currently based on a template, not on nginx::resource:vhost. tested on centos 7.

bastelfreak avatar Nov 07 '14 16:11 bastelfreak

Hey stephenrjohnson, could you take a look at the code?

bastelfreak avatar Nov 12 '14 10:11 bastelfreak

I'll get to this on the weekend, sorry about the delay.

stephenrjohnson avatar Nov 13 '14 21:11 stephenrjohnson

I'm interested in having this merged as well please @stephenrjohnson

gavinrogers avatar Nov 25 '14 13:11 gavinrogers

Hey @stephenrjohnson possible for you to take a look at this?

bastelfreak avatar Dec 08 '14 13:12 bastelfreak

epel offers python-gunicorn.. ? why compile it?

i think there should be an option to use a local package - i try to avoid compiling on production machines where i can...

arenstar avatar Dec 09 '14 11:12 arenstar

Well, unicorn isn't the same as gunicorn. In general I noticed that the rpms are most of the time outdated so I prefer gems. Also unicorn isn't available via base/epel/extras repos on CentOS7

bastelfreak avatar Dec 09 '14 12:12 bastelfreak

bastelfreak - i just actually just realised my error there. yep.. Sorry bout that..

Is it possible to have the option of using a package instead though? ill often build my own packages and distribute them for my systems

arenstar avatar Dec 09 '14 12:12 arenstar

So an option to swtich between the gem or an rpm and the option to specifiy the name of the rpm? Can I assume that the rpm is available via any configured repository? would this suit your needs?

bastelfreak avatar Dec 09 '14 13:12 bastelfreak

I'm holding off merging this until you have made the changes, outlined above.

stephenrjohnson avatar Dec 09 '14 14:12 stephenrjohnson

bastelfreak, exactly :+1:

in my situation id simply like to offer a rpm package name, which would avoid installing and building using gcc - etc.

Soo setting the package_name

it would also be important to set

installpath - https://github.com/stephenrjohnson/puppetmodule/pull/74/files#diff-85eb9f3c6e80aebeebc8c583f5afd80bR5

and i noticed you arent using the puppet_passenger_port -> https://github.com/stephenrjohnson/puppetmodule/pull/74/files#diff-d52434b9535ec86f061db077733da1fbR23

there are other modules out there which manage repository management. Lets assume that the rpm should just be available to the system :)

arenstar avatar Dec 09 '14 14:12 arenstar

Can I assume that the binary is always available in your $PATH? Your do you want to specify the complete path to the binary?

I will try to add the changes later this week. are you able to write some unit/rspec tests?

bastelfreak avatar Dec 09 '14 14:12 bastelfreak

hey @stephenrjohnson could you please take a look at this? implemented the mentioned stuff from @arenstar

let me know if I should rebase it into one commit

bastelfreak avatar Jan 22 '15 14:01 bastelfreak

tested this yesterday on several nodes together with @gavinrogers and we fixed two bugs. currently it is running fine on multiple production systems

bastelfreak avatar Jan 23 '15 08:01 bastelfreak

The last think we need is some tests as this is a massive change. Have a look in spec/acceptance/ and we don't have any spec tests to test both branches of the webserver tree or even any for the unicorn class.

stephenrjohnson avatar Jan 28 '15 08:01 stephenrjohnson

anybody with a bit of experience in writing tests around that could assist me? Maybe @gavinrogers ?

bastelfreak avatar Jan 28 '15 15:01 bastelfreak

@stephenrjohnson i've started working on spec tests etc. i was curious about the acceptance tests, i noticed that one of the targets is centos7, but i haven't yet found a way to install passenger on centos7, where is the package coming from? i've got it working fine on that platform using the unicorn class, let me get the tests done

gavinrogers avatar Feb 04 '15 13:02 gavinrogers

You're writing the tests? Awesome! thanks!

bastelfreak avatar Feb 04 '15 13:02 bastelfreak

@gavinrogers If you look at the spec_helper_acceptance

if osfamily == 'RedHat' on host, puppet('module', 'install', 'stahnma-epel'), { :acceptable_exit_codes => [0,1] } on host, puppet('apply', '-e', '"class {epel:}"'), { :acceptable_exit_codes => [0] } #passenger repo shell("rpm -iv http://yum.theforeman.org/releases/latest/el#{osrelease}/x86_64/foreman-release.rpm") end

stephenrjohnson avatar Feb 20 '15 08:02 stephenrjohnson

Extremely interested in this option. The rest of our stack runs on Nginx & Unicorn/Gunicorn so this would sit within that perfectly.

Obviously the progress on this change has been slow lately. Is there anything I can do to assist in merging it in? Happy to assist with puppet code, testing etc

benfairless avatar Apr 22 '15 18:04 benfairless

please please please write tests. I've no clue about that, would be awesome if you could contribute it.

bastelfreak avatar Apr 22 '15 18:04 bastelfreak

Is that the only change necessary? I'd like to see the vhost for nginx setup using jfryman/nginx. Can do that too if you'd like?

benfairless avatar Apr 22 '15 18:04 benfairless

I can take a look again and try to create a vhost config via jfryman/nginx. Do you know a bit about selinux and can maybe improve the current settings?

bastelfreak avatar Apr 22 '15 18:04 bastelfreak

I've merged all the upstream code and fixed all existing tests (other than ones not passing upstream). Whilst writing unit tests for unicorn though I noticed that none of the parameters for puppet::unicorn have default values at this point. I might have to make some more significant modifications to get it working in a sane manner.

benfairless avatar Apr 22 '15 22:04 benfairless

looks way better now, travis shows only three issues, all not based on this code.

bastelfreak avatar Apr 23 '15 10:04 bastelfreak

The issues are caused by your merges not being clean this really needs rebasing on matser.

stephenrjohnson avatar Apr 23 '15 17:04 stephenrjohnson

rebase is on its way!

bastelfreak avatar Apr 23 '15 21:04 bastelfreak

@stephenrjohnson would it be okay for you if I squash this into one commit before rebasing?

bastelfreak avatar Apr 23 '15 22:04 bastelfreak

Not the best but sure it's fine.

stephenrjohnson avatar Apr 24 '15 07:04 stephenrjohnson

Did a huge squash and then rebased against your master

bastelfreak avatar Apr 24 '15 13:04 bastelfreak

Why is this still breaking the tests that work before the merge.

stephenrjohnson avatar Apr 27 '15 08:04 stephenrjohnson