aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/haproxy/tasks
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-23 13:19:08 +0000
committerGerrit Code Review <review@openstack.org>2015-12-23 13:19:08 +0000
commit027e70f9a270b54f2e41208956262ee89875bd4a (patch)
tree60d97c1f3e9072c16358986288f8c9c5d609e775 /ansible/roles/haproxy/tasks
parentbd1fdf3b4ca7f15ccb4fb4ada57ee35a107ad3be (diff)
parented82afa8e928ac7c9f5ad2162be2c27eaab8e2e6 (diff)
downloadkolla-027e70f9a270b54f2e41208956262ee89875bd4a.tar.gz
kolla-027e70f9a270b54f2e41208956262ee89875bd4a.zip
Merge "Simplify config creation"
Diffstat (limited to 'ansible/roles/haproxy/tasks')
-rwxr-xr-xansible/roles/haproxy/tasks/config.yml41
1 files changed, 18 insertions, 23 deletions
diff --git a/ansible/roles/haproxy/tasks/config.yml b/ansible/roles/haproxy/tasks/config.yml
index d5e3711a6..9df07fd1e 100755
--- a/ansible/roles/haproxy/tasks/config.yml
+++ b/ansible/roles/haproxy/tasks/config.yml
@@ -1,36 +1,31 @@
---
-- name: Ensuring config directory exists
- file:
- path: "{{ node_config_directory }}/haproxy/"
- state: "directory"
- recurse: "yes"
-
-- name: Copying over config(s)
- template:
- src: "haproxy.cfg.j2"
- dest: "{{ node_config_directory }}/haproxy/haproxy.cfg"
-
-- name: Copying haproxy JSON configuration file
- template:
- src: "haproxy.json.j2"
- dest: "{{ node_config_directory }}/haproxy/config.json"
-
- name: Allowing non-local IP binding
sysctl: name="net.ipv4.ip_nonlocal_bind" value=1 sysctl_set=yes
when: set_sysctl | bool
-- name: Ensuring config directory exists
+- name: Ensuring config directories exist
file:
- path: "{{ node_config_directory }}/keepalived/"
+ path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
- recurse: "yes"
+ recurse: yes
+ with_items:
+ - "keepalived"
+ - "haproxy"
+
+- name: Copying over config.json files for services
+ template:
+ src: "{{ item }}.json.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/config.json"
+ with_items:
+ - "keepalived"
+ - "haproxy"
-- name: Copying keepalived JSON configuration file
+- name: Copying over haproxy.cfg
template:
- src: "keepalived.json.j2"
- dest: "{{ node_config_directory }}/keepalived/config.json"
+ src: "haproxy.cfg.j2"
+ dest: "{{ node_config_directory }}/haproxy/haproxy.cfg"
-- name: Copying over config(s)
+- name: Copying over keepalived.conf
template:
src: "keepalived.conf.j2"
dest: "{{ node_config_directory }}/keepalived/keepalived.conf"