Merge "Add proxy validation for undercloud deployment."
This commit is contained in:
commit
abc77c232d
6
doc/source/roles/role-undercloud_proxy_validation.rst
Normal file
6
doc/source/roles/role-undercloud_proxy_validation.rst
Normal file
@ -0,0 +1,6 @@
|
||||
===========================
|
||||
undercloud_proxy_validation
|
||||
===========================
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_proxy_validation
|
22
playbooks/undercloud-proxy-validation.yaml
Normal file
22
playbooks/undercloud-proxy-validation.yaml
Normal 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
|
1
roles/undercloud_proxy_validation/defaults/main.yml
Normal file
1
roles/undercloud_proxy_validation/defaults/main.yml
Normal file
@ -0,0 +1 @@
|
||||
---
|
11
roles/undercloud_proxy_validation/tasks/main.yml
Normal file
11
roles/undercloud_proxy_validation/tasks/main.yml
Normal 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
|
15
roles/undercloud_proxy_validation/vars/main.yaml
Normal file
15
roles/undercloud_proxy_validation/vars/main.yaml
Normal 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()) }}"
|
Loading…
Reference in New Issue
Block a user