diff --git a/playbooks/maas-pre-flight.yml b/playbooks/maas-pre-flight.yml index 783501bcd..73f36b453 100644 --- a/playbooks/maas-pre-flight.yml +++ b/playbooks/maas-pre-flight.yml @@ -50,7 +50,7 @@ msg: >- There are missing metadata environment variable(s), as you can see 'unknown' from this test template '{{ rendered_maas_metata_test_tmpl }}'. Please set proper env - variables, possible options are: maas_env_identifier, maas_rpco_dir, maas_osa_dir + variables, possible options are: maas_env_identifier, maas_product_dir, maas_product_osa_dir when: - maas_pre_flight_metadata_check_enabled | default(true) | bool - rendered_maas_metata_test_tmpl | search('unknown') diff --git a/playbooks/templates/common/macros.jinja b/playbooks/templates/common/macros.jinja index 61dd79a76..51acfd7e8 100644 --- a/playbooks/templates/common/macros.jinja +++ b/playbooks/templates/common/macros.jinja @@ -18,13 +18,17 @@ host {# we can change to hardware here if we want #} {% macro get_metadata(label) %} -{% set get_rpco_version_cmd="(cd "+maas_rpco_dir|default('/opt/rpc-openstack')+"&& git describe --tags --abbrev=0) || echo 'unknown\'" %} -{% set get_osa_version_cmd="(cd "+maas_osa_dir|default('/opt/rpc-openstack/openstack-ansible')+"&& git describe --tags --abbrev=0) || "+"(cd "+ maas_2nd_osa_dir|default('/opt/openstack-ansible')+ "&& git describe --tags --abbrev=0) || echo 'unknown\'" %} +{% set get_product_version_cmd="(cd "+maas_product_dir|default('/opt/rpc-openstack')+"&& git describe --tags --abbrev=0) || echo 'unknown\'" %} +{% set get_product_osa_version_cmd="(cd "+maas_product_osa_dir|default('/opt/rpc-openstack/openstack-ansible')+"&& git describe --tags --abbrev=0) || "+"(cd "+ maas_2nd_product_osa_dir|default('/opt/openstack-ansible')+ "&& git describe --tags --abbrev=0) || echo 'unknown\'" %} metadata : - product: "rpco" + product: "{{ maas_env_product | default('rpco') }}" rpc_env_identifier: "{{ maas_env_identifier | default('unknown')}}" - product_version: "{{ lookup('pipe', get_rpco_version_cmd )}}" - osa_version: "{{ lookup('pipe', get_osa_version_cmd )}}" +{% if not(maas_env_product is defined and maas_env_product == 'osa') %} + product_version: "{{ lookup('pipe', get_product_version_cmd )}}" +{% endif %} +{% if not(maas_env_product is defined and 'ceph' in maas_env_product) %} + osa_version: "{{ lookup('pipe', get_product_osa_version_cmd )}}" +{% endif %} rpc_maas_version: "{{ lookup('pipe', 'cd .. && git describe --tags --abbrev=0') }}" rpc_maas_deploy_date: "{{ ansible_date_time.date }}" rpc_check_category: "{{ get_check_category(label).strip() }}" diff --git a/releasenotes/notes/TURTLES-762-ceph-e7491abc69c94c7a.yaml b/releasenotes/notes/TURTLES-762-ceph-e7491abc69c94c7a.yaml new file mode 100644 index 000000000..2342d3aa6 --- /dev/null +++ b/releasenotes/notes/TURTLES-762-ceph-e7491abc69c94c7a.yaml @@ -0,0 +1,9 @@ +--- + +fixes: + - | + Add an extra maas_env_product, defaults to 'rpco'. In ceph environment + it should be set to 'ceph'. Also maas_rpco_dir has been renamed to + maas_product_dir, and osa version will be left out in the case of ceph + environment +