buscarron and honoroit - add basic auth for metrics

This commit is contained in:
Aine
2023-04-21 12:45:32 +03:00
parent beb40134b7
commit c20d74af79
6 changed files with 118 additions and 2 deletions

View File

@ -40,6 +40,20 @@
- {path: "{{ matrix_bot_honoroit_docker_src_files_path }}", when: true}
when: "item.when | bool"
- name: Determine basicauth filename
set_fact:
matrix_bot_honoroit_basicauth_file_tmp: "{{ matrix_bot_honoroit_basicauth_file }}_{{ inventory_hostname }}"
when: matrix_bot_honoroit_basicauth_enabled | bool
- name: Generate basic auth file
community.general.htpasswd:
path: "{{ matrix_bot_honoroit_basicauth_file }}"
name: "{{ matrix_bot_honoroit_basicauth_user }}"
password: "{{ matrix_bot_honoroit_basicauth_password }}"
become: false
delegate_to: 127.0.0.1
when: matrix_bot_honoroit_basicauth_enabled | bool
- name: Ensure honoroit support files installed
ansible.builtin.template:
src: "{{ role_path }}/templates/{{ item }}.j2"
@ -51,6 +65,14 @@
- env
- labels
- name: Ensure temporary basic auth file is removed
ansible.builtin.file:
path: "{{ matrix_bot_honoroit_basicauth_file }}"
state: absent
become: false
delegate_to: 127.0.0.1
when: matrix_bot_honoroit_basicauth_enabled | bool
- name: Ensure honoroit image is pulled
community.docker.docker_image:
name: "{{ matrix_bot_honoroit_docker_image }}"