diff --git a/ansible/oooq/roles/oooq-metadata/tasks/main.yml b/ansible/oooq/roles/oooq-metadata/tasks/main.yml index 2c8ffa112..33eb7a630 100644 --- a/ansible/oooq/roles/oooq-metadata/tasks/main.yml +++ b/ansible/oooq/roles/oooq-metadata/tasks/main.yml @@ -6,12 +6,23 @@ register: build ignore_errors: true -- name: Determine if deployment is containerized - stat: - path: /usr/lib/systemd/system/docker.service - register: docker_service_file +- name: Determine if docker is running + shell: docker ps | wc -l + register: docker_ps delegate_to: overcloud-controller-0 - become: True + ignore_errors: True + +- name: Set var for container deployment + set_fact: + containers: True + when: docker_ps.stdout|int > 1 + ignore_errors: True + +- name: Set fact for non-container deployment + set_fact: + containers: False + when: docker_ps.stdout|int < 2 + ignore_errors: True - name: Make sure the results directory exists file: "path={{ ansible_env.HOME }}/browbeat/metadata state=directory" diff --git a/ansible/oooq/roles/oooq-metadata/templates/version.json.j2 b/ansible/oooq/roles/oooq-metadata/templates/version.json.j2 index 662c11bc4..3472ea245 100644 --- a/ansible/oooq/roles/oooq-metadata/templates/version.json.j2 +++ b/ansible/oooq/roles/oooq-metadata/templates/version.json.j2 @@ -5,10 +5,13 @@ {% set series = {"rhos-7": "7", "rhos-8": "8", "rhos-9": "9", "rhos-10": "10", "rhos-11": "11", "rhos-12": "12", "rhos-13": "13", "master": "master"}[osp_release] | default("Unknown Version") -%} {% set version = {"rhos-7": "7-director", "rhos-8": "8-director", "rhos-9": "9-director", "rhos-10":"10-director", "rhos-11": "11-director", "rhos-12": "12-director", "rhos-13": "13-director", "master": "master-director"}[osp_release] | default("Unknown Version") -%} {% endif %} +{% if containers is not defined %} +{% set containers = False %} +{% endif %} { "osp_series": "{{series}}", "osp_version": "{{version}}", - "containerized:": "{{docker_service_file.stat.exists}}", + "containerized:": "{{containers}}", "dlrn_hash": "{{dlrn_hash}}", "logs_link": "{{logs_link}}", "rhos_puddle": "{{rhos_puddle}}",