keepalived: allow disabling

Sem-Ver: feature
Change-Id: I01903ce2d3173b52cdf18f31dd3c7d22b26c26db
diff --git a/releasenotes/notes/allow-no-keepalived-32ac8b6630df1448.yaml b/releasenotes/notes/allow-no-keepalived-32ac8b6630df1448.yaml
new file mode 100644
index 0000000..f255545
--- /dev/null
+++ b/releasenotes/notes/allow-no-keepalived-32ac8b6630df1448.yaml
@@ -0,0 +1,4 @@
+---
+features:
+  - Add ability for a user to avoid using Keepalived for Kubernetes in cases
+    where the API is behind an external load balancer.
diff --git a/roles/kubernetes/tasks/control-plane.yml b/roles/kubernetes/tasks/control-plane.yml
index 829b82f..347340d 100644
--- a/roles/kubernetes/tasks/control-plane.yml
+++ b/roles/kubernetes/tasks/control-plane.yml
@@ -13,6 +13,7 @@
 # under the License.
 
 - name: Upload configuration for Keepalived
+  when: kubernetes_keepalived_interface is defined
   block:
     - name: Create folder
       ansible.builtin.file:
@@ -42,6 +43,7 @@
         mode: 0644
 
 - name: Upload configuration for HAproxy
+  when: kubernetes_keepalived_interface is defined
   block:
     - name: Create folder
       ansible.builtin.file: