diff --git a/library/haproxy_commands.py b/library/haproxy_commands.py index fe90b2b9d..83e932c8e 100644 --- a/library/haproxy_commands.py +++ b/library/haproxy_commands.py @@ -21,6 +21,7 @@ def _haproxy_state(host, state, app_name): "php_blauwrood_servers": {"php_blauwrood_servers": True, "type": "list"}, "static_blauwrood_servers": {"static_blauwrood_servers": True, "type": "list"}, "stepup_blauwrood_servers": {"stepup_blauwrood_servers": True, "type": "list"}, + "docker_blauwrood_servers": {"docker_blauwrood_servers": True, "type": "list"}, "weight": {"type": "str"}, "color": {"required": True, "type": "str"}, "app_name": {"required": True, "type": "str"}, @@ -32,6 +33,7 @@ def _haproxy_state(host, state, app_name): php_servers = [s["label"] for s in module.params["php_blauwrood_servers"]] static_servers = [s["label"] for s in module.params["static_blauwrood_servers"]] stepup_servers = [s["label"] for s in module.params["stepup_blauwrood_servers"]] + docker_servers = [s["label"] for s in module.params["docker_blauwrood_servers"]] app_name = module.params["app_name"].lower() app_type = module.params["app_type"].lower() @@ -48,6 +50,8 @@ def _haproxy_state(host, state, app_name): servers = static_servers elif app_type == "stepup": servers = stepup_servers + elif app_type == "docker": + servers = docker_servers red_servers = [s for s in servers if s.upper().endswith("ROOD")] blue_servers = [s for s in servers if s.upper().endswith("BLAUW")] diff --git a/roles/haproxy_mgnt/tasks/main.yml b/roles/haproxy_mgnt/tasks/main.yml index 4669b0616..5babeb3f3 100644 --- a/roles/haproxy_mgnt/tasks/main.yml +++ b/roles/haproxy_mgnt/tasks/main.yml @@ -17,6 +17,7 @@ php_blauwrood_servers: "{{ php_blauwrood_servers }}" static_blauwrood_servers: "{{ static_blauwrood_servers }}" stepup_blauwrood_servers: "{{ stepup_blauwrood_servers }}" + docker_blauwrood_servers: "{{ docker_blauwrood_servers }}" weight: "{{ weight }}" color: "{{ color }}" app_name: "{{ app_name }}" @@ -30,6 +31,7 @@ php_blauwrood_servers: "{{ php_blauwrood_servers }}" static_blauwrood_servers: "{{ static_blauwrood_servers }}" stepup_blauwrood_servers: "{{ stepup_blauwrood_servers }}" + docker_blauwrood_servers: "{{ docker_blauwrood_servers }}" color: "{{ color }}" state: "{{ state }}" app_name: "{{ app_name }}"