Skip to content

Commit

Permalink
Conditionally install Python deps
Browse files Browse the repository at this point in the history
- Add performance tuning configuration (thanks @t0k4rt)
- Update documentation
- Conditionally install Python dependency baed on virtualenv or --user
  Addresses #129 (comment)
  • Loading branch information
brianshumate committed Jan 9, 2018
1 parent 8a699f0 commit 8bb22b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,3 +771,6 @@ Actually add new template files :facepalm:
## v1.30.1 (UNRELEASED)

- Add performance tuning configuration (thanks @t0k4rt)
- Update documentation
- Conditionally install Python dependency baed on virtualenv or --user
Addresses https://github.com/brianshumate/ansible-consul/issues/129#issuecomment-356095611
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,21 @@ consul3.node.consul. 0 IN A 10.1.42.230
- Custom list of addresses to listen on.
- Default value: *[]*

### `consul_performance`

This is a nested object of Consul performance related options.

#### `consul_performance.raft_multiplier`

This is the [raft multiplier](https://www.consul.io/docs/agent/options.html#raft_multiplier). See also [Server Performance](https://www.consul.io/docs/guides/performance.html).

#### `consul_performance.leave_drain_time`

This is the [leave drain time](https://www.consul.io/docs/agent/options.html#leave_drain_time).

#### `consul_performance.rpc_hold_timeout`

This is the [RPC hold timeout](https://www.consul.io/docs/agent/options.html#rpc_hold_timeout).

### iptables DNS Forwarding Support

Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## Core
consul_debug: no
is_virtualenv: "{{ lookup('env','VIRTUAL_ENV') | default('', true) }}"

### Package
consul_version: "{{ lookup('env','CONSUL_VERSION') | default('1.0.2', true) }}"
Expand Down
10 changes: 9 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
---
# File: main.yml - Main tasks for Consul

- name: Install netaddr dependency on controlling host as user
- name: Install netaddr dependency on controlling host (with --user)
pip:
name: netaddr
extra_args: --user
delegate_to: 127.0.0.1
become: false
when: is_virtualenv is not defined

- name: Install netaddr dependency on controlling host (virtualenv)
pip:
name: netaddr
delegate_to: 127.0.0.1
become: false
when: is_virtualenv is defined

- name: Include checks/asserts
include: asserts.yml
Expand Down

0 comments on commit 8bb22b6

Please sign in to comment.