Skip to content

Commit

Permalink
Merge pull request #90 from spinx/nginx_optional
Browse files Browse the repository at this point in the history
Allow for Consul UI w/o nginx install
  • Loading branch information
mattfinlayson committed Jan 14, 2016
2 parents 390d34b + 2237ee6 commit bad4cbd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,22 @@ Here is a list of all the default variables for this role, which are also availa

```yml
---
consul_version: 0.5.2
consul_archive: "{{ consul_version }}_linux_amd64.zip"
consul_download: "https://dl.bintray.com/mitchellh/consul/{{ consul_archive }}"
consul_version: 0.6.0
consul_archive: "consul_{{ consul_version }}_linux_amd64.zip"
consul_download: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{ consul_archive }}"
consul_download_username: ""
consul_download_password: ""
consul_download_folder: /tmp

consul_is_ui: false
consul_ui_archive: "{{ consul_version }}_web_ui.zip"
consul_ui_download: "https://dl.bintray.com/mitchellh/consul/{{ consul_ui_archive }}"
consul_ui_archive: "consul_{{ consul_version }}_web_ui.zip"
consul_ui_download: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{ consul_ui_archive }}"
consul_ui_dir: "{{ consul_home }}/dist"
consul_ui_server_name: "{{ ansible_fqdn }}"
consul_ui_require_auth: false
consul_ui_auth_user_file: /etc/htpasswd/consul
consul_install_nginx: true
consul_install_nginx_config: true
consul_enable_nginx_config: true

consul_install_consul_cli: false
Expand Down
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
consul_version: 0.5.2
consul_version: 0.6.0
consul_archive: "consul_{{ consul_version }}_linux_amd64.zip"
consul_download: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{ consul_archive }}"
consul_download_username: ""
Expand All @@ -15,6 +15,8 @@ consul_ui_require_auth: false
consul_ui_nginx_template: "consul-nginx.conf.j2"
consul_ui_auth_user_file: /etc/htpasswd/consul
consul_ui_server_port: 80
consul_install_nginx: true
consul_install_nginx_config: true
consul_enable_nginx_config: true

consul_install_consul_cli: false
Expand Down
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ galaxy_info:
categories:
- system
dependencies:
- { role: franklinkim.nginx, when: consul_is_ui == true and ansible_os_family == "Debian" }
- { role: geerlingguy.nginx, when: consul_is_ui == true and ansible_os_family == "RedHat" }
- { role: franklinkim.nginx, when: consul_install_nginx == true and ansible_os_family == "Debian" }
- { role: geerlingguy.nginx, when: consul_install_nginx == true and ansible_os_family == "RedHat" }
- { role: joshualund.golang, when: consul_install_consul_cli == true }
8 changes: 4 additions & 4 deletions tasks/install-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
owner=root
group=root
mode=0755
when: consul_is_ui and ansible_os_family == "Debian"
when: consul_install_nginx_config and ansible_os_family == "Debian"
notify:
- restart nginx

- name: consul nginx config
- name: consul nginx config enable
file: >
state=link
src=/etc/nginx/sites-available/consul
Expand All @@ -64,7 +64,7 @@
owner=root
group=root
mode=0755
when: consul_is_ui and ansible_os_family == "RedHat"
when: consul_is_ui and consul_install_nginx_config and ansible_os_family == "RedHat"

- name: create nginx home
file: >
Expand All @@ -75,4 +75,4 @@
mode=0755
notify:
- restart nginx
when: consul_enable_nginx_config
when: consul_install_nginx_config and consul_enable_nginx_config

0 comments on commit bad4cbd

Please sign in to comment.