--- # # Slurp OSP version file # - name: Check if /etc/rhosp-release exists stat: path: /etc/rhosp-release register: rhosp_release_stat - name: Get OSP Version become: true slurp: src: "/etc/rhosp-release" register: osp_version when: rhosp_release_stat.stat.exists - debug: msg="WARNING /etc/rhosp-release not found, defaulting version of OSP to Pike" when: not rhosp_release_stat.stat.exists - name: Set OSP Version Default set_fact: osp_version: content: "{{'Pike' | b64encode}}" when: not rhosp_release_stat.stat.exists - name: set numeric version for release set_fact: version: "{{ osp_version.content | b64decode }}" - name: set rhosp version (downstream) set_fact: rhosp_version: "{{ version.split()[5] }}" - name: set rhosp major version (downstream) set_fact: rhosp_major: "{{ osp_version.content | b64decode | regex_replace('^Red Hat OpenStack Platform release ([0-9]+)\\.\\d+.*\n', '\\1') }}"