Merge "Add proxy validation for undercloud deployment."

This commit is contained in:
Zuul 2022-07-13 14:45:30 +00:00 committed by Gerrit Code Review
commit abc77c232d
5 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,6 @@
===========================
undercloud_proxy_validation
===========================
.. ansibleautoplugin::
:role: roles/undercloud_proxy_validation

View File

@ -0,0 +1,22 @@
---
- hosts: undercloud
vars:
metadata:
name: Verify proxy variables are properly set
description: |
Check proxy configuration before running a stack update - especially minor update and major upgrade.
groups:
- backup-and-restore
- post-upgrade
- pre-upgrade
- post-update
- pre-update
categories:
- os
- system
- systemd
- services
products:
- tripleo
roles:
- undercloud_proxy_validation

View File

@ -0,0 +1 @@
---

View File

@ -0,0 +1,11 @@
---
- name: Fail if no_proxy is not set
fail:
msg: >-
http_proxy and/or https_proxy are set but no_proxy is not set.
no_proxy needs to contain 127.0.0.1 or any of the undercloud
public/private IPs otherwise deployment and/or upgrade will fail.
failed_when: "item.stdout == 'ActiveState=active'"
when: (http_proxy|length > 0 or https_proxy|length > 0 is defined) and no_proxy|length == 0 or
(HTTP_PROXY|length > 0 or HTTPS_PROXY|length > 0 is defined) and NO_PROXY|length == 0 or

View File

@ -0,0 +1,15 @@
---
metadata:
name: Verify undercloud proxy configuration
description: >
Check undercloud proxy configuration before a stack update - especially minor update and major upgrade.
groups:
- post-upgrade
- pre-upgrade
vars:
HTTP_PROXY: "{{ lookup('ansible.builtin.env', 'HTTP_PROXY', default=undef()) }}"
HTTPS_PROXY: "{{ lookup('ansible.builtin.env', 'HTTPS_PROXY', default=undef()) }}"
NO_PROXY: "{{ lookup('ansible.builtin.env', 'NO_PROXY', default=undef()) }}"
http_proxy: "{{ lookup('ansible.builtin.env', 'http_proxy', default=undef()) }}"
https_proxy: "{{ lookup('ansible.builtin.env', 'https_proxy', default=undef()) }}"
no_proxy: "{{ lookup('ansible.builtin.env', 'no_proxy', default=undef()) }}"