Merge pull request #140 from guidograzioli/molecule_jbcs_to_nginx

use nginx instead of jbcs for https_revproxy test
This commit is contained in:
Guido Grazioli 2023-12-05 20:09:08 +01:00 committed by GitHub
commit 33e6d428b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 26 deletions

View file

@ -15,4 +15,4 @@ jobs:
with:
fqcn: 'middleware_automation/keycloak'
molecule_tests: >-
[ "default", "overridexml", "quarkus", "quarkus-devmode" ]
[ "default", "overridexml", "https_revproxy", "quarkus", "quarkus-devmode" ]

View file

@ -41,8 +41,6 @@ provisioner:
ansible_python_interpreter: "{{ ansible_playbook_python }}"
env:
ANSIBLE_FORCE_COLOR: "true"
REDHAT_PRODUCT_DOWNLOAD_CLIENT_ID: "${PROD_JBOSSNETWORK_API_CLIENTID}"
REDHAT_PRODUCT_DOWNLOAD_CLIENT_SECRET: "${PROD_JBOSSNETWORK_API_SECRET}"
verifier:
name: ansible
scenario:

View file

@ -3,7 +3,7 @@
hosts: all
tasks:
- name: Install sudo
ansible.builtin.yum:
ansible.builtin.dnf:
name: sudo
state: present
@ -14,36 +14,35 @@
- name: Prepare proxy
hosts: proxy
vars:
jbcs_mod_cluster_enable: True
jbcs_configure_firewalld: False
jbcs_offline_install: False
jbcs_bind_address: '*'
jbcs_proxy_pass:
- path: /
url: http://instance:8080/
reverse_path: /
reverse_url: http://instance:8080/
external_domain_name: proxy
rhn_username: "{{ lookup('env', 'REDHAT_PRODUCT_DOWNLOAD_CLIENT_ID') }}"
rhn_password: "{{ lookup('env', 'REDHAT_PRODUCT_DOWNLOAD_CLIENT_SECRET') }}"
nginx_proxy: |
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://instance:8080;
}
roles:
- middleware_automation.jbcs.jbcs
- elan.simple_nginx_reverse_proxy
pre_tasks:
- name: Create certificate request
ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=proxy'
delegate_to: localhost
changed_when: False
changed_when: false
- name: Make certificate directory
ansible.builtin.file:
path: /etc/nginx/tls
state: directory
- name: Copy certificates
ansible.builtin.copy:
src: "{{ item.name }}"
dest: "{{ item.dest }}"
mode: 0444
become: True
become: true
loop:
- { name: 'cert.pem', dest: '/etc/pki/tls/certs/proxy.crt' }
- { name: 'key.pem', dest: '/etc/pki/tls/private/proxy.key' }
- name: update_ca_trust
command: update-ca-trust
become: True
- { name: 'cert.pem', dest: '/etc/nginx/tls/certificate.crt' }
- { name: 'key.pem', dest: '/etc/nginx/tls/certificate.key' }
- name: Update CA trust
ansible.builtin.command: update-ca-trust
changed_when: false
become: true

View file

@ -6,3 +6,6 @@ collections:
- name: ansible.posix
- name: community.docker
version: ">=1.9.1"
roles:
- name: elan.simple_nginx_reverse_proxy