tripleo-operator-ansible/roles/tripleo_repos/tasks/main.yml

45 lines
1.5 KiB
YAML

---
# tasks file for tripleo_repos
# TODO(mwhahaha): uncomment this once we have a version of ansible with
# https://github.com/ansible/ansible/pull/65776
#
# - name: Gather distribution facts
# setup:
# gather_subset: "!all,!min,distribution,distribution_major_version"
- name: Gather the rpm package facts
package_facts:
- name: Install tripleo-repos
include_tasks: install.yml
when: (ansible_facts.distribution_major_version|int <= 7 and not 'python2-tripleo-repos' in ansible_facts.packages) or
(ansible_facts.distribution_major_version|int >= 8 and not 'python3-tripleo-repos' in ansible_facts.packages)
- name: Setup tripleo repos ansible facts
set_fact:
_repos_cmd: >-
tripleo-repos
{{ tripleo_repos_branch | ternary('-b ' ~ tripleo_repos_branch, '') }}
{{ tripleo_repos_distro | ternary('-d ' ~ tripleo_repos_distro, '') }}
{{ tripleo_repos_output_path | ternary('-o ' ~ tripleo_repos_output_path, '') }}
{{ tripleo_repos_mirror | ternary('--mirror ' ~ tripleo_repos_mirror, '') }}
{{ tripleo_repos_rdo_mirror | ternary('--rdo-mirror ' ~ tripleo_repos_rdo_mirror, '') }}
{{ tripleo_repos_stream | ternary('--stream', '') }}
{{ tripleo_repos_extra_args | join(' ') }}
{{ tripleo_repos_repos | join( ' ') }}
- name: Show debug information
when: tripleo_repos_debug|bool
block:
- name: Show the tripleo repos command
debug:
var: _repos_cmd
- name: Run tripleo-repos
shell: "{{ _repos_cmd }}"
args:
warn: false
become: true
changed_when: true