From d21c02c87b64733e8a37238c5a33dfb2ab9b10c5 Mon Sep 17 00:00:00 2001 From: Ruslan Aliev Date: Tue, 21 Jul 2020 11:53:15 -0500 Subject: [PATCH] Fix airshipctl-roles-test gate job Due to incorrect processing IP:port pairs using 'regex_replace' filter, roles-test gate job fails. This patches fixes all the related errors and CI gate check itself. Change-Id: Ifd7f890166195df0af9b34e1ccff59b7abd2d9ab Relates-To: #305 Closes: #305 Signed-off-by: Ruslan Aliev --- roles/apache-file-exchanger/tasks/main.yaml | 2 +- roles/apache-file-exchanger/templates/conf.j2 | 2 +- roles/apache-file-exchanger/templates/ssl.conf.j2 | 2 +- roles/apache-server/tasks/install.yaml | 1 - roles/apache-wsgi-sushy-emulator/tasks/frontend.yaml | 10 +++++----- .../templates/wsgi-sushy-emulator-ssl.conf.j2 | 2 +- .../templates/wsgi-sushy-emulator.conf.j2 | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/roles/apache-file-exchanger/tasks/main.yaml b/roles/apache-file-exchanger/tasks/main.yaml index b528c5709..0432d7349 100644 --- a/roles/apache-file-exchanger/tasks/main.yaml +++ b/roles/apache-file-exchanger/tasks/main.yaml @@ -101,7 +101,7 @@ apache_server_ssl_key_path: "/etc/ssl/private/{{ file_exchanger_name }}.key" apache_server_ssl_cert_path: "/etc/ssl/certs/{{ file_exchanger_name }}.pem" apache_server_ssl_cn: "{{ file_exchanger_servername }}" - apache_server_ssl_alt_name: "{{ file_exchanger_ip | map('regex_replace', '(.*)', 'IP:\\1') | list }}" + apache_server_ssl_alt_name: "{{ file_exchanger_ip | map('regex_replace', '^(.*)$', 'IP:\\1') | list }}" - name: Generate certs for case without alt_names when: file_exchanger_ip is undefined or file_exchanger_ip == None diff --git a/roles/apache-file-exchanger/templates/conf.j2 b/roles/apache-file-exchanger/templates/conf.j2 index 30d05684d..217c77d97 100644 --- a/roles/apache-file-exchanger/templates/conf.j2 +++ b/roles/apache-file-exchanger/templates/conf.j2 @@ -3,7 +3,7 @@ {% if file_exchanger_http_port != 80 %} Listen {{ file_exchanger_http_port }} {% endif %} - + # Add machine's IP address (use ifconfig command) ServerName {{ file_exchanger_servername }} diff --git a/roles/apache-file-exchanger/templates/ssl.conf.j2 b/roles/apache-file-exchanger/templates/ssl.conf.j2 index 7560fbbac..e8e6ef71e 100644 --- a/roles/apache-file-exchanger/templates/ssl.conf.j2 +++ b/roles/apache-file-exchanger/templates/ssl.conf.j2 @@ -4,7 +4,7 @@ {% if file_exchanger_https_port != 443 %} Listen {{ file_exchanger_https_port }} {% endif %} - + # Add machine's IP address (use ifconfig command) {% if file_exchanger_user is defined and file_exchanger_user != None %} diff --git a/roles/apache-server/tasks/install.yaml b/roles/apache-server/tasks/install.yaml index 747062065..02e839391 100644 --- a/roles/apache-server/tasks/install.yaml +++ b/roles/apache-server/tasks/install.yaml @@ -56,4 +56,3 @@ service: name: apache2 state: reloaded - diff --git a/roles/apache-wsgi-sushy-emulator/tasks/frontend.yaml b/roles/apache-wsgi-sushy-emulator/tasks/frontend.yaml index 39414f2f7..ca27790d3 100644 --- a/roles/apache-wsgi-sushy-emulator/tasks/frontend.yaml +++ b/roles/apache-wsgi-sushy-emulator/tasks/frontend.yaml @@ -68,7 +68,7 @@ apache_server_ssl_key_path: "/etc/ssl/private/{{ sushy_emulator_frontend_name }}.key" apache_server_ssl_cert_path: "/etc/ssl/certs/{{ sushy_emulator_frontend_name }}.pem" apache_server_ssl_cn: "{{ sushy_emulator_frontend_servername }}" - apache_server_ssl_alt_name: "{{ sushy_emulator_frontend_ip | map('regex_replace', '(.*)', 'IP:\\1') | list }}" + apache_server_ssl_alt_name: "{{ sushy_emulator_frontend_ip | map('regex_replace', '^(.*)$', 'IP:\\1') | list }}" - name: Generate certs for case without alt_names when: sushy_emulator_frontend_ip is undefined @@ -111,7 +111,7 @@ - name: Check without auth when: sushy_emulator_frontend_user is undefined uri: - url: http://{{ sushy_emulator_frontend_servername }}:{{sushy_emulator_frontend_http_port }}/redfish/v1/Systems?format=json + url: http://{{ sushy_emulator_frontend_servername }}:{{ sushy_emulator_frontend_http_port }}/redfish/v1/Systems?format=json method: GET return_content: yes register: sushy_get_result @@ -122,7 +122,7 @@ - name: Check with auth when: sushy_emulator_frontend_user is defined uri: - url: http://{{ sushy_emulator_frontend_servername }}:{{sushy_emulator_frontend_http_port }}/redfish/v1/Systems?format=json + url: http://{{ sushy_emulator_frontend_servername }}:{{ sushy_emulator_frontend_http_port }}/redfish/v1/Systems?format=json url_username: "{{ sushy_emulator_frontend_user[0].username }}" url_password: "{{ sushy_emulator_frontend_user[0].password }}" method: GET @@ -134,14 +134,14 @@ - name: Check without auth when: sushy_emulator_frontend_user is undefined uri: - url: https://{{ sushy_emulator_frontend_servername }}:{{sushy_emulator_frontend_https_port }}/redfish/v1/Systems?format=json + url: https://{{ sushy_emulator_frontend_servername }}:{{ sushy_emulator_frontend_https_port }}/redfish/v1/Systems?format=json method: GET validate_certs: false return_content: yes - name: Check with auth when: sushy_emulator_frontend_user is defined uri: - url: https://{{ sushy_emulator_frontend_servername }}:{{sushy_emulator_frontend_https_port }}/redfish/v1/Systems?format=json + url: https://{{ sushy_emulator_frontend_servername }}:{{ sushy_emulator_frontend_https_port }}/redfish/v1/Systems?format=json url_username: "{{ sushy_emulator_frontend_user[0].username }}" url_password: "{{ sushy_emulator_frontend_user[0].password }}" validate_certs: false diff --git a/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator-ssl.conf.j2 b/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator-ssl.conf.j2 index 335b7a393..b2c02a10a 100644 --- a/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator-ssl.conf.j2 +++ b/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator-ssl.conf.j2 @@ -2,7 +2,7 @@ {% if sushy_emulator_frontend_https_port != 443 %} Listen {{ sushy_emulator_frontend_https_port }} {% endif %} - + # Add machine's IP address (use ifconfig command) ServerName {{ sushy_emulator_frontend_servername }} # Give an alias to to start your website url with diff --git a/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator.conf.j2 b/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator.conf.j2 index 0cab1d8fe..ee848bfbc 100644 --- a/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator.conf.j2 +++ b/roles/apache-wsgi-sushy-emulator/templates/wsgi-sushy-emulator.conf.j2 @@ -1,7 +1,7 @@ {% if sushy_emulator_frontend_http_port != 80 %} Listen {{ sushy_emulator_frontend_http_port }} {% endif %} - + # Add machine's IP address (use ifconfig command) ServerName {{ sushy_emulator_frontend_servername }} # Give an alias to to start your website url with