From 688a673c48d6a3b8b8ce5e7480bd1e598a7c4ff5 Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Thu, 5 Aug 2021 15:33:55 +0430 Subject: [PATCH] ceph-container-engine: allow override container_package_name and container_service_name Only include specific variables when they are undefined Signed-off-by: Seena Fallah (cherry picked from commit 95bce32270c7f5ea7e397588340b674efd7db63f) --- .../tasks/pre_requisites/prerequisites.yml | 1 + roles/ceph-validate/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/roles/ceph-container-engine/tasks/pre_requisites/prerequisites.yml b/roles/ceph-container-engine/tasks/pre_requisites/prerequisites.yml index baa373bfc..479856d84 100644 --- a/roles/ceph-container-engine/tasks/pre_requisites/prerequisites.yml +++ b/roles/ceph-container-engine/tasks/pre_requisites/prerequisites.yml @@ -4,6 +4,7 @@ with_first_found: - "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" - "{{ ansible_facts['os_family'] }}.yml" + when: container_package_name is undefined and container_service_name is undefined - name: debian based systems tasks include_tasks: debian_prerequisites.yml diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 447f2d6c9..0658f4318 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -237,6 +237,13 @@ - (ceph_docker_registry_username is not defined or ceph_docker_registry_password is not defined) or (ceph_docker_registry_username | length == 0 or ceph_docker_registry_password | length == 0) +- name: validate container service and container package + fail: + msg: 'both container_package_name and container_service_name should be defined' + when: + - (container_package_name is undefined and container_service_name is defined) or + (container_package_name is defined and container_service_name is undefined) + - name: validate openstack_keys key format fail: msg: '{{ item.name }} key format invalid'