emmetog / ansible-jenkins

Ansible role to install and fully configure Jenkins CI in Docker
MIT License
104 stars 89 forks source link

Add support for HTTPS, improve handling of Jenkins URL #48

Closed nre-ableton closed 5 years ago

nre-ableton commented 5 years ago

This PR adds support for HTTPS, based on the information in https://wiki.jenkins.io/display/JENKINS/Starting+and+Accessing+Jenkins. I realize that the README recommends using a reverse proxy instead (and I've since adapted the README in this PR), but that configuration is much easier with Docker and a bit more involved for native installations.

This PR also changes the way that jenkins_url is defined. It has always bugged me a tiny bit that jenkins_url was not actually a URL, but just a protocol + hostname combo without the port, and thus required several instances of {{ jenkins_url }}:{{ jenkins_port }} in various tasks in this role.

Instead, jenkins_url has been replaced with jenkins_hostname, in addition to the port and the correct protocol depending on whether or not HTTPS configuration was desired. However, I have considered backwards compatibility here, and this role will still work for users who define jenkins_url.

This PR also includes a few minor cleanups, specifically with regards to un-quoting task names (usually not a common practice in Ansible), cleanups to the README.md file, and fixed a typo/error in the yum installation method.

ping @emmetog

nre-ableton commented 5 years ago

Edit: After a bit of consideration, I realized that it is not necessary to introduce a breaking change into this role and I found a way to support users who will still be defining jenkins_url the old way.

emmetog commented 5 years ago

Thanks @nre-ableton! Could you take a look at the conflicts?

nre-ableton commented 5 years ago

@emmetog Ok, I've rebased this PR and fixed the merge conflicts. I've also moved some of the cleanup commits out of this branch and into a general cleanups branch that I've been working on, which I will push after the current batch of PRs is finished.

As for https://github.com/emmetog/ansible-jenkins/pull/49, this PR touches configure-plugins.yml and will probably cause more merge conflicts there, so let's merge this one first and worry about that one afterwards.