Check repository availability
Change-Id: Idd7c1663f6378c86b6fef7cfb1e77faedc3e57ea Implements: blueprint pre-upgrade-validations
This commit is contained in:
parent
fb7346fbfc
commit
3cc9a39053
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds a validation to the pre-upgrade group that checks if current
|
||||||
|
repositories can be connected to and if there is at least one repo
|
||||||
|
configured in yum repolist.
|
23
validations/check-repo-availability.yaml
Normal file
23
validations/check-repo-availability.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- hosts: undercloud, overcloud
|
||||||
|
vars:
|
||||||
|
metadata:
|
||||||
|
name: Check availability of current repositories
|
||||||
|
description: >
|
||||||
|
Detect whether the repositories listed in `yum repolist`
|
||||||
|
can be connected to and that there is at least one repo
|
||||||
|
configured.
|
||||||
|
groups:
|
||||||
|
- pre-upgrade
|
||||||
|
tasks:
|
||||||
|
- name: Find repository URLs
|
||||||
|
shell: 'yum repolist -v | grep Repo-baseurl | sed "s/Repo-baseurl.*\(http[^ ]*\).*/\1/g"'
|
||||||
|
register: repository_urls
|
||||||
|
- name: Check if there is at least one repository baseurl
|
||||||
|
fail:
|
||||||
|
msg: No repository found in yum repolist
|
||||||
|
when: repository_urls.stdout_lines|length < 1
|
||||||
|
- name: Call repository URLs
|
||||||
|
uri:
|
||||||
|
url: "{{ item }}"
|
||||||
|
with_items: repository_urls.stdout_lines
|
Loading…
x
Reference in New Issue
Block a user