Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Apache and nginx basic and role examples should allow for the port to defined. #239

Merged
merged 6 commits into from
Feb 14, 2018

Conversation

bbaassssiiee
Copy link
Contributor

This implements the changes for #92

Apache and Nginx basic and role examples should allow for the port to defined.

@bbaassssiiee bbaassssiiee changed the title apache and nginx basic and role examples should allow for the port to defined. Apache and nginx basic and role examples should allow for the port to defined. Dec 13, 2017
@tima
Copy link
Collaborator

tima commented Dec 14, 2017

Thanks for your contribution @bbaassssiiee. Before we could merge this, some of the workshops and their solutions docs need to be modified to be consistent with the examples being modified here.

  • facilitator/solutions/roles.md
  • workshops/basic_playbook/README.md
  • workshops/basic_playbook/resources/nginx.conf.j2

@tima tima requested review from dfederlein and thedoubl3j January 11, 2018 20:52
@tima
Copy link
Collaborator

tima commented Jan 11, 2018

Thanks for this @bbaassssiiee. Looks good at a glance. I'm going to try put this thru its paces with a few people just to verify since this is part of the mainline ongoing Red Hat workshops.

@bbaassssiiee
Copy link
Contributor Author

bbaassssiiee commented Jan 11, 2018

For beginner training you might consider the value of having a variable 'webserver_port' vs. 'apache_webserver_port' and 'nginx_webserver_port'. Best practices call for a prefix as currently used.

@bbaassssiiee
Copy link
Contributor Author

Resolved conflicts (trailing whitespace)

@tima
Copy link
Collaborator

tima commented Jan 17, 2018

Thanks for your suggestion. The potential for a namespace collision is more likely with a name being as generic as 'webserver_port". I've seen many a play with apache and nginx or tomcat running on them. I'm of the mind that we should set a good example that gets students/users into habits that avoid such eventualities. When I speak about Ansible best practices, I not only encourage them to use descriptive, unique human-meaningful variable names (one can argue webserver_port does or doesn't there) but to also prefix variables with it’s “owner” such as a role name or package. I think something named "apache" or "nginx" are more common than naming a role "webserver."

@bbaassssiiee
Copy link
Contributor Author

So this PR implements the changes for #92 after reviews it can be merged IMHO.

@tima
Copy link
Collaborator

tima commented Jan 18, 2018

Got it @bbaassssiiee. I'll try to find some time to test this out myself. I've pinged some of the contributors to give this a go also.

Thanks for your cooperation and help here.

@gundalow
Copy link
Collaborator

Closing/Reopening to cause Travis to run.

@gundalow gundalow closed this Jan 25, 2018
@gundalow gundalow reopened this Jan 25, 2018
Copy link
Collaborator

@tima tima left a comment

Choose a reason for hiding this comment

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

I did a test run of all the examples this touched a found a few small bugs. I've left comments as close as could. Github code review only allows comments on lines that changed. I came across a couple of other minor issues that I will open separate tickets in the interest of getting this one merged as soon as you can fix address the issues I found here.

# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Below this around line 183 (Github won't let me leave a comment on a line you didn't change) there is a MaxKeepAliveRequests {{ apache_max_keep_alive_requests }} in this template that wasn't removed and is giving me an error in my tests.

@@ -10,7 +10,7 @@
- python-devel
- gcc
nginx_test_message: This is a test message
nginx_keepalive_timeout: 115
nginx_webserver_port: 80
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine but the smoke test task below starting on line 48 fails if you change this default value during your run. You need url: http://localhost:{{ nginx_webserver_port }}/ there.

@@ -1,4 +1,4 @@
---
# defaults file for nginx
nginx_test_message: This is a test message
nginx_keepalive_timeout: 115
nginx_webserver_port: 80
Copy link
Collaborator

Choose a reason for hiding this comment

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

Github code review doesn't allow you to leave comments on any line that was not touched (missed) in a change. This example fails if you change this default port value during your run. The smoke test task needs url: http://localhost:{{ nginx_webserver_port }}/ in the task/main.yml file there.

@tima
Copy link
Collaborator

tima commented Feb 13, 2018

ping @bbaassssiiee -- this PR is waiting on your input.

@tima
Copy link
Collaborator

tima commented Feb 14, 2018

Thanks for doing this @bbaassssiiee. I found a few issues I suspect where introduced in #266 that you merged in. I'm going to merge this PR and fix that immediately.

@tima tima merged commit 2d3bcc9 into ansible:master Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants