Skip to content

Commit

Permalink
Merge pull request #511 from tonytan4ever/TURTLES-762-ceph
Browse files Browse the repository at this point in the history
Making metadata working with ceph deployments
  • Loading branch information
tonytan4ever authored May 31, 2018
2 parents e72d8f7 + 009b6a6 commit 3e6473f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion playbooks/maas-pre-flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 9 additions & 5 deletions playbooks/templates/common/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}"
Expand Down
9 changes: 9 additions & 0 deletions releasenotes/notes/TURTLES-762-ceph-e7491abc69c94c7a.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3e6473f

Please sign in to comment.