Make yamllint happy (take 2)
> Error: 19:3 error wrong indentation: expected 4 but found 2 (indentation)
This commit is contained in:
parent
9aab7f9c37
commit
1727ecd888
@ -16,40 +16,40 @@
|
|||||||
# We support various distros, with various versions of Python. Installing additional Python modules can be a hassle.
|
# We support various distros, with various versions of Python. Installing additional Python modules can be a hassle.
|
||||||
# As a workaround, we run `htpasswd` from an Apache container image.
|
# As a workaround, we run `htpasswd` from an Apache container image.
|
||||||
- block:
|
- block:
|
||||||
- name: Ensure Apache Docker image is pulled for generating matrix-metrics-htpasswd from username/password (protecting /metrics/* URIs)
|
- name: Ensure Apache Docker image is pulled for generating matrix-metrics-htpasswd from username/password (protecting /metrics/* URIs)
|
||||||
docker_image:
|
docker_image:
|
||||||
name: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_image }}"
|
name: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_image }}"
|
||||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||||
force_source: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
force_source: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_force_pull }}"
|
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_force_pull }}"
|
||||||
|
|
||||||
# We store the password in a file and make the `htpasswd` tool read it from there,
|
# We store the password in a file and make the `htpasswd` tool read it from there,
|
||||||
# as opposed to passing it directly on stdin (which will expose it to other processes on the server).
|
# as opposed to passing it directly on stdin (which will expose it to other processes on the server).
|
||||||
- name: Store metrics password in a temporary file
|
- name: Store metrics password in a temporary file
|
||||||
copy:
|
copy:
|
||||||
content: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_password }}"
|
content: "{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_password }}"
|
||||||
dest: "/tmp/matrix-nginx-proxy-metrics-password"
|
dest: "/tmp/matrix-nginx-proxy-metrics-password"
|
||||||
mode: 0400
|
mode: 0400
|
||||||
owner: "{{ matrix_user_uid }}"
|
owner: "{{ matrix_user_uid }}"
|
||||||
group: "{{ matrix_user_gid }}"
|
group: "{{ matrix_user_gid }}"
|
||||||
|
|
||||||
- name: Generate matrix-metrics-htpasswd from username/password (protecting /metrics/* URIs)
|
- name: Generate matrix-metrics-htpasswd from username/password (protecting /metrics/* URIs)
|
||||||
command:
|
command:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
{{ matrix_host_command_docker }} run
|
{{ matrix_host_command_docker }} run
|
||||||
--rm
|
--rm
|
||||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }}
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }}
|
||||||
--cap-drop=ALL
|
--cap-drop=ALL
|
||||||
--network=none
|
--network=none
|
||||||
--mount type=bind,src={{ matrix_nginx_proxy_data_path }},dst=/data
|
--mount type=bind,src={{ matrix_nginx_proxy_data_path }},dst=/data
|
||||||
--mount type=bind,src=/tmp/matrix-nginx-proxy-metrics-password,dst=/password,ro
|
--mount type=bind,src=/tmp/matrix-nginx-proxy-metrics-password,dst=/password,ro
|
||||||
--entrypoint=/bin/sh
|
--entrypoint=/bin/sh
|
||||||
{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_image }}
|
{{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_apache_container_image }}
|
||||||
-c
|
-c
|
||||||
'cat /password | htpasswd -i -c /data/matrix-metrics-htpasswd {{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_username }} && chmod 600 /data/matrix-metrics-htpasswd'
|
'cat /password | htpasswd -i -c /data/matrix-metrics-htpasswd {{ matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_username }} && chmod 600 /data/matrix-metrics-htpasswd'
|
||||||
|
|
||||||
- name: Delete temporary metrics password file
|
- name: Delete temporary metrics password file
|
||||||
file:
|
file:
|
||||||
path: /tmp/matrix-nginx-proxy-metrics-password
|
path: /tmp/matrix-nginx-proxy-metrics-password
|
||||||
state: absent
|
state: absent
|
||||||
when: matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_username != ''
|
when: matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_username != ''
|
||||||
|
Loading…
Reference in New Issue
Block a user