Browse Source

Merge "Allow disabling keepalived for external LBs"

tags/8.0.0.0b1
Zuul 5 months ago
parent
commit
3af135d4fb

+ 1
- 0
ansible/group_vars/all.yml View File

@@ -417,6 +417,7 @@ openstack_interface: "admin"
417 417
 # could disable some of these required roles and run their own services.
418 418
 enable_glance: "yes"
419 419
 enable_haproxy: "yes"
420
+enable_keepalived: "{{ enable_haproxy | bool }}"
420 421
 enable_keystone: "yes"
421 422
 enable_mariadb: "yes"
422 423
 enable_memcached: "yes"

+ 1
- 1
ansible/roles/haproxy/defaults/main.yml View File

@@ -16,7 +16,7 @@ haproxy_services:
16 16
   keepalived:
17 17
     container_name: keepalived
18 18
     group: haproxy
19
-    enabled: true
19
+    enabled: "{{ enable_keepalived | bool }}"
20 20
     image: "{{ keepalived_image_full }}"
21 21
     privileged: True
22 22
     volumes:

+ 2
- 1
ansible/roles/haproxy/tasks/config.yml View File

@@ -5,7 +5,8 @@
5 5
   with_items:
6 6
     - { name: "net.ipv4.ip_nonlocal_bind", value: 1}
7 7
     - { name: "net.unix.max_dgram_qlen", value: 128}
8
-  when: set_sysctl | bool
8
+  when:
9
+    - set_sysctl | bool
9 10
 
10 11
 - name: Ensuring config directories exist
11 12
   file:

+ 11
- 1
ansible/roles/haproxy/tasks/precheck.yml View File

@@ -11,12 +11,16 @@
11 11
   changed_when: False
12 12
   check_mode: no
13 13
   run_once: true
14
+  when:
15
+    - enable_keepalived | bool
14 16
 
15 17
 - name: Create empty temp kolla_keepalived_running file
16 18
   local_action: copy content=None dest=/tmp/kolla_keepalived_running mode=0644
17 19
   changed_when: False
18 20
   check_mode: no
19 21
   run_once: true
22
+  when:
23
+    - enable_keepalived | bool
20 24
 
21 25
 - name: Getting hosts who is running keepalived
22 26
   local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_keepalived_running mode=0644
@@ -25,17 +29,21 @@
25 29
   when:
26 30
     - inventory_hostname in groups['haproxy']
27 31
     - container_facts['keepalived'] is defined
28
-    - enable_haproxy | bool
32
+    - enable_keepalived | bool
29 33
 
30 34
 - name: Registering host running keepalived
31 35
   set_fact:
32 36
     host_running_keepalived: "{{ lookup('file', '/tmp/kolla_keepalived_running') }}"
37
+  when:
38
+    - enable_keepalived | bool
33 39
 
34 40
 - name: Clearing temp kolla_keepalived_running file
35 41
   local_action: file path=/tmp/kolla_keepalived_running state=absent
36 42
   changed_when: False
37 43
   check_mode: no
38 44
   run_once: true
45
+  when:
46
+    - enable_keepalived | bool
39 47
 
40 48
 - name: Clearing temp kolla_haproxy_running file
41 49
   local_action: file path=/tmp/kolla_haproxy_running state=absent
@@ -103,6 +111,7 @@
103 111
     - "{{ kolla_internal_vip_address }}"
104 112
     - "{{ kolla_external_vip_address }}"
105 113
   when:
114
+    - enable_keepalived | bool
106 115
     - "host_running_keepalived == 'None'"
107 116
     - enable_haproxy | bool
108 117
 
@@ -153,6 +162,7 @@
153 162
      kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none)
154 163
   when:
155 164
     - enable_haproxy | bool
165
+    - enable_keepalived | bool
156 166
     - container_facts['keepalived'] is not defined
157 167
     - inventory_hostname in groups['haproxy']
158 168
 

+ 5
- 0
releasenotes/notes/allow-disabling-keepalived-310321889a848edf.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+features:
3
+  - |
4
+    Add a configuration option `enable_keepalived` to allow disabling the
5
+    service. This is useful when using an external LB in front of HAProxy.

Loading…
Cancel
Save