Skip to content

Commit

Permalink
Merge pull request #7 from asujenkinsapp/master
Browse files Browse the repository at this point in the history
Clean up variables
  • Loading branch information
brianshumate authored Oct 24, 2016
2 parents ee7ded2 + 1a2c166 commit 4cec229
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ The role specifies variables in `defaults/main.yml` and `vars/*.yml`.
| `consul_log_path` | `/var/log/consul` | Log path |
| `consul_user` | `consul` | OS user |
| `consul_group` | `bin` | OS group |
| `consul_group_name` | `cluster_nodes` | Inventory group name |
| `consul_datacenter` | `dc1` | Datacenter label |
| `consul_domain` | `consul` | Consul domain name |
| `consul_log_level` | `INFO` | Log level |
| `consul_syslog_enable` | `true` | Log to syslog |
| `consul_iface` | `eth1` | Consul network interface |
| `consul_bind_address` | `127.0.0.1` | Bind address |
| `consul_bootstrap_interface` | `{{ hostvars[groups['cluster_nodes'][0]]['ansible_eth1']['ipv4']['address'] }}` | The server interface that additional server nodes will join to for bootstrapping |
| `consul_bootstrap_address` | `{{ hostvars[groups[consul_group_name][0]]['ansible_'+consul_iface]['ipv4']['address'] }}` | The server interface that additional server nodes will join to for bootstrapping |
| `consul_dns_bind_address` | `127.0.0.1` | DNS API bind address |
| `consul_http_bind_address` | `0.0.0.0` | HTTP API bind address |
| `consul_https_bind_address` | `0.0.0.0` | HTTPS API bind address |
Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ consul_ui_url: "https://releases.hashicorp.com/consul/{{ consul_version }}/consu
consul_ui_pkg: "{{ consul_version }}_web_ui.zip"
consul_ui_sha256: "5f8841b51e0e3e2eb1f1dc66a47310ae42b0448e77df14c83bb49e0e0d5fa4b7"
consul_iface: "eth1"
consul_bind_address: "{{ hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] }}"
consul_bind_address: "{{ hostvars[inventory_hostname]['ansible_'+consul_iface]['ipv4']['address'] }}"
consul_dns_bind_address: "127.0.0.1"
consul_http_bind_address: "0.0.0.0"
consul_https_bind_address: "0.0.0.0"
consul_rpc_bind_address: "0.0.0.0"
consul_bootstrap_interface: "{{ hostvars[groups['cluster_nodes'][0]]['ansible_eth1']['ipv4']['address'] }}"
consul_bootstrap_address: "{{ hostvars[groups[consul_group_name][0]]['ansible_'+consul_iface]['ipv4']['address'] }}"
consul_node_name: "{{ inventory_hostname_short }}"
consul_acl_enable: "false"
consul_acl_datacenter: "{{ consul_datacenter }}"
Expand Down
2 changes: 1 addition & 1 deletion templates/client_config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"log_level": "{{ consul_log_level }}",
"enable_syslog": {{ consul_syslog_enable }},
"start_join": {{ lbracket }}{% for host in groups[consul_group_name] %}
{{ comma() }}{{ quote }}{{ hostvars[host]['ansible_eth1']['ipv4']['address'] }}{{ quote }}
{{ comma() }}{{ quote }}{{ hostvars[host]['ansible_'+consul_iface]['ipv4']['address'] }}{{ quote }}
{% endfor %}{{ rbracket }}
}
2 changes: 1 addition & 1 deletion templates/server_config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"encrypt": "{{ consul_raw_key['stdout']}}",
"log_level": "{{ consul_log_level }}",
"enable_syslog": {{ consul_syslog_enable }},
"start_join": {{ lbracket }}{{ quote }}{{ consul_bootstrap_interface }}{{ quote }}{{ rbracket }},
"start_join": {{ lbracket }}{{ quote }}{{ consul_bootstrap_address }}{{ quote }}{{ rbracket }},
"ui": true
}

0 comments on commit 4cec229

Please sign in to comment.