Added Senlin

Change-Id: I523d9b583305e2459135e3bbb0e442592c9d74fd
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index 2be9955..ad7954a 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -109,6 +109,11 @@
         openstack_helm_endpoints_octavia_mariadb_password: octavia-mariadb-password
         openstack_helm_endpoints_octavia_rabbitmq_password: octavia-rabbitmq-password
         openstack_helm_endpoints_octavia_keystone_password: octavia-keystone-password
+        # Senlin
+        openstack_helm_endpoints_senlin_api_host: "clustering.{{ hostvars['ctl1']['ansible_host'].replace('.', '-') }}.nip.io"
+        openstack_helm_endpoints_senlin_mariadb_password: senlin-mariadb-password
+        openstack_helm_endpoints_senlin_rabbitmq_password: senlin-rabbitmq-password
+        openstack_helm_endpoints_senlin_keystone_password: senlin-keystone-password
         # Heat
         openstack_helm_endpoints_heat_api_host: "orchestration.{{ hostvars['ctl1']['ansible_host'].replace('.', '-') }}.nip.io"
         openstack_helm_endpoints_heat_keystone_password: heat-keystone-password
diff --git a/playbooks/openstack.yml b/playbooks/openstack.yml
index 31d0a04..e005549 100644
--- a/playbooks/openstack.yml
+++ b/playbooks/openstack.yml
@@ -96,6 +96,10 @@
       tags:
         - openstack-helm-nova
 
+    - role: openstack_helm_senlin
+      tags:
+        - openstack-helm-senlin
+
     - role: openstack_helm_heat
       tags:
         - openstack-helm-heat
diff --git a/roles/openstack_helm_endpoints/defaults/main.yml b/roles/openstack_helm_endpoints/defaults/main.yml
index 0338286..721dcc5 100644
--- a/roles/openstack_helm_endpoints/defaults/main.yml
+++ b/roles/openstack_helm_endpoints/defaults/main.yml
@@ -87,6 +87,13 @@
 openstack_helm_endpoints_octavia_mariadb_password: "{{ undef(hint='You must specify an Octavia MariaDB password') }}"
 openstack_helm_endpoints_octavia_rabbitmq_password: "{{ undef(hint='You must specify an Octavia RabbitMQ password') }}"
 
+# Senlin
+openstack_helm_endpoints_senlin_api_host: "{{ undef(hint='You must specify a Senlin API hostname') }}"
+openstack_helm_endpoints_senlin_region_name: "{{ openstack_helm_endpoints_region_name }}"
+openstack_helm_endpoints_senlin_keystone_password: "{{ undef(hint='You must specify a Senlin Keystone password') }}"
+openstack_helm_endpoints_senlin_mariadb_password: "{{ undef(hint='You must specify a Senlin MariaDB password') }}"
+openstack_helm_endpoints_senlin_rabbitmq_password: "{{ undef(hint='You must specify a Senlin RabbitMQ password') }}"
+
 # Heat
 openstack_helm_endpoints_heat_api_host: "{{ undef(hint='You must specify a Heat API hostname') }}"
 openstack_helm_endpoints_heat_region_name: "{{ openstack_helm_endpoints_region_name }}"
diff --git a/roles/openstack_helm_endpoints/vars/main.yml b/roles/openstack_helm_endpoints/vars/main.yml
index eb46051..92429be 100644
--- a/roles/openstack_helm_endpoints/vars/main.yml
+++ b/roles/openstack_helm_endpoints/vars/main.yml
@@ -327,6 +327,31 @@
       api:
         public: 443
 
+_openstack_helm_endpoints_clustering:
+  identity:
+    auth:
+      senlin:
+        region_name: "{{ openstack_helm_endpoints_senlin_region_name }}"
+        username: "cinder-{{ openstack_helm_endpoints_senlin_region_name }}"
+        password: "{{ openstack_helm_endpoints_senlin_keystone_password }}"
+  clustering:
+    scheme:
+      public: https
+    host_fqdn_override:
+      public:
+        host: "{{ openstack_helm_endpoints_senlin_api_host }}"
+    port:
+      api:
+        public: 443
+  oslo_db:
+    auth:
+      senlin:
+        password: "{{ openstack_helm_endpoints_senlin_mariadb_password }}"
+  oslo_messaging:
+    auth:
+      senlin:
+        password: "{{ openstack_helm_endpoints_senlin_rabbitmq_password }}"
+
 _openstack_helm_endpoints_orchestration:
   identity:
     auth:
diff --git a/roles/openstack_helm_senlin/defaults/main.yml b/roles/openstack_helm_senlin/defaults/main.yml
new file mode 100644
index 0000000..b9b1822
--- /dev/null
+++ b/roles/openstack_helm_senlin/defaults/main.yml
@@ -0,0 +1,26 @@
+# Copyright (c) 2022 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+openstack_helm_senlin_chart_repo_name: openstack-helm
+openstack_helm_senlin_chart_repo_url: https://tarballs.opendev.org/openstack/openstack-helm/
+openstack_helm_senlin_chart_name: senlin
+
+openstack_helm_senlin_image_repository: "{{ atmosphere_image_repository | default('us-docker.pkg.dev/vexxhost-infra/openstack') }}"
+openstack_helm_senlin_image_tag: 11.0.1.dev3
+openstack_helm_senlin_heat_image_tag: wallaby
+
+openstack_helm_senlin_diff: false
+openstack_helm_senlin_migrate_from_mariadb: false
+
+openstack_helm_senlin_values: {}
diff --git a/roles/openstack_helm_senlin/meta/main.yml b/roles/openstack_helm_senlin/meta/main.yml
new file mode 100644
index 0000000..32e974e
--- /dev/null
+++ b/roles/openstack_helm_senlin/meta/main.yml
@@ -0,0 +1,19 @@
+# Copyright (c) 2022 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+dependencies:
+  - role: helm_repository
+    vars:
+      helm_repository_name: "{{ openstack_helm_senlin_chart_repo_name }}"
+      helm_repository_repo_url: "{{ openstack_helm_senlin_chart_repo_url }}"
diff --git a/roles/openstack_helm_senlin/tasks/main.yml b/roles/openstack_helm_senlin/tasks/main.yml
new file mode 100644
index 0000000..073bb7c
--- /dev/null
+++ b/roles/openstack_helm_senlin/tasks/main.yml
@@ -0,0 +1,68 @@
+# Copyright (c) 2022 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Generate OpenStack-Helm endpoints
+  ansible.builtin.include_role:
+    name: openstack_helm_endpoints
+  vars:
+    openstack_helm_endpoints_repo_name: "{{ openstack_helm_senlin_chart_repo_name }}"
+    openstack_helm_endpoints_repo_url: "{{ openstack_helm_senlin_chart_repo_url }}"
+    openstack_helm_endpoints_chart: "{{ openstack_helm_senlin_chart_name }}"
+
+- name: Generate Helm values comparison
+  ansible.builtin.include_role:
+    name: helm_diff
+  vars:
+    helm_diff_release_name: "{{ openstack_helm_senlin_chart_name }}"
+    helm_diff_release_namespace: openstack
+    helm_diff_values: "{{ _openstack_helm_senlin_values }}"
+  when:
+    - openstack_helm_senlin_diff | bool
+
+- name: Migrate database from MariaDB to Percona XtraDB Cluster
+  ansible.builtin.include_role:
+    name: openstack_helm_migrate_to_percona_xtradb_cluster
+  vars:
+    openstack_helm_migrate_to_percona_xtradb_cluster_release_name: "{{ openstack_helm_senlin_chart_name }}"
+    openstack_helm_migrate_to_percona_xtradb_cluster_release_namespace: openstack
+    openstack_helm_migrate_to_percona_xtradb_cluster_databases:
+      - senlin
+    openstack_helm_migrate_to_percona_xtradb_cluster_services:
+      - kind: Deployment
+        name: senlin-api
+      - kind: Deployment
+        name: senlin-conductor
+      - kind: Deployment
+        name: senlin-engine
+      - kind: Deployment
+        name: senlin-health-manager
+  when:
+    - openstack_helm_senlin_migrate_from_mariadb | bool
+
+- name: Deploy Helm chart
+  kubernetes.core.helm:
+    name: "{{ openstack_helm_senlin_chart_name }}"
+    chart_ref: "{{ openstack_helm_senlin_chart_repo_name }}/{{ openstack_helm_senlin_chart_name }}"
+    chart_version: 0.2.3
+    release_namespace: openstack
+    kubeconfig: /etc/kubernetes/admin.conf
+    values: "{{ _openstack_helm_senlin_values }}"
+
+- name: Create Ingress
+  ansible.builtin.include_role:
+    name: openstack_helm_ingress
+  vars:
+    openstack_helm_ingress_endpoint: clustering
+    openstack_helm_ingress_service_name: senlin-api
+    openstack_helm_ingress_service_port: 8778
diff --git a/roles/openstack_helm_senlin/vars/main.yml b/roles/openstack_helm_senlin/vars/main.yml
new file mode 100644
index 0000000..21ae792
--- /dev/null
+++ b/roles/openstack_helm_senlin/vars/main.yml
@@ -0,0 +1,46 @@
+# Copyright (c) 2022 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+_openstack_helm_senlin_values: "{{ __openstack_helm_senlin_values | combine(openstack_helm_senlin_values, recursive=True) }}"
+__openstack_helm_senlin_values:
+  endpoints: "{{ openstack_helm_endpoints }}"
+  images:
+    tags:
+      bootstrap: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      db_drop: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      db_init: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      dep_check: "{{ openstack_helm_senlin_image_repository }}/kubernetes-entrypoint:latest"
+      ks_endpoints: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      ks_service: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      ks_user: "{{ openstack_helm_senlin_image_repository }}/heat:{{ openstack_helm_senlin_heat_image_tag }}"
+      rabbit_init: "{{ openstack_helm_senlin_image_repository }}/rabbitmq:3.8.23-management"
+      senlin_api: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+      senlin_conductor: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+      senlin_db_sync: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+      senlin_engine_cleaner: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+      senlin_engine: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+      senlin_health_manager: "{{ openstack_helm_senlin_image_repository }}/senlin:{{ openstack_helm_senlin_image_tag }}"
+  pod:
+    replicas:
+      api: 3
+      conductor: 3
+      engine: 3
+      health_manager: 3
+  conf:
+    senlin:
+      DEFAULT:
+        log_config_append: null
+  manifests:
+    ingress_api: false
+    service_ingress_api: false