More ansible-lint fixes

development
Slavi Pantaleev 2 years ago
parent 983bf819ef
commit d073c7ecb3

@ -20,7 +20,7 @@
register: lsb_release_installation_result register: lsb_release_installation_result
- name: Reread ansible_lsb facts if lsb-release got installed - name: Reread ansible_lsb facts if lsb-release got installed
setup: filter=ansible_lsb* ansible.builtin.setup: filter=ansible_lsb*
when: lsb_release_installation_result.changed when: lsb_release_installation_result.changed
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml"

@ -10,7 +10,7 @@
update_cache: true update_cache: true
- name: Ensure Docker's APT key is trusted - name: Ensure Docker's APT key is trusted
apt_key: ansible.builtin.apt_key:
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present state: present
@ -19,7 +19,7 @@
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker repository is enabled - name: Ensure Docker repository is enabled
apt_repository: ansible.builtin.apt_repository:
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
state: present state: present
update_cache: true update_cache: true

@ -12,7 +12,7 @@
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: ansible.builtin.rpm_key:
state: present state: present
key: https://download.docker.com/linux/fedora/gpg key: https://download.docker.com/linux/fedora/gpg
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
@ -33,7 +33,7 @@
when: matrix_docker_installation_enabled | bool when: matrix_docker_installation_enabled | bool
- name: Ensure Docker-Py is installed - name: Ensure Docker-Py is installed
pip: ansible.builtin.pip:
name: docker-py name: docker-py
state: latest state: latest
when: matrix_docker_installation_enabled | bool when: matrix_docker_installation_enabled | bool

@ -10,7 +10,7 @@
update_cache: true update_cache: true
- name: Ensure Docker's APT key is trusted - name: Ensure Docker's APT key is trusted
apt_key: ansible.builtin.apt_key:
url: https://download.docker.com/linux/raspbian/gpg url: https://download.docker.com/linux/raspbian/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present state: present
@ -19,7 +19,7 @@
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker repository is enabled - name: Ensure Docker repository is enabled
apt_repository: ansible.builtin.apt_repository:
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable"
state: present state: present
update_cache: true update_cache: true

@ -10,7 +10,7 @@
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: ansible.builtin.rpm_key:
state: present state: present
key: https://download.docker.com/linux/centos/gpg key: https://download.docker.com/linux/centos/gpg
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'

@ -10,7 +10,7 @@
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: ansible.builtin.rpm_key:
state: present state: present
key: https://download.docker.com/linux/centos/gpg key: https://download.docker.com/linux/centos/gpg
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
@ -38,7 +38,7 @@
when: matrix_docker_installation_enabled | bool when: matrix_docker_installation_enabled | bool
- name: Ensure Docker-Py is installed - name: Ensure Docker-Py is installed
pip: ansible.builtin.pip:
name: docker-py name: docker-py
state: latest state: latest
when: matrix_docker_installation_enabled | bool when: matrix_docker_installation_enabled | bool

@ -81,6 +81,7 @@
- name: Ensure MX Puppet Twitter repository is present on self build - name: Ensure MX Puppet Twitter repository is present on self build
ansible.builtin.git: ansible.builtin.git:
repo: "{{ matrix_mx_puppet_twitter_container_image_self_build_repo }}" repo: "{{ matrix_mx_puppet_twitter_container_image_self_build_repo }}"
version: master
dest: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}" dest: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}"
force: "yes" force: "yes"
become: true become: true

@ -29,6 +29,7 @@ matrix_dynamic_dns_systemd_required_services_list: ['docker.service']
# Build the container from source when running in mode # Build the container from source when running in mode
matrix_dynamic_dns_container_image_self_build: false matrix_dynamic_dns_container_image_self_build: false
matrix_dynamic_dns_container_image_self_build_repo: "https://github.com/linuxserver/docker-ddclient.git" matrix_dynamic_dns_container_image_self_build_repo: "https://github.com/linuxserver/docker-ddclient.git"
matrix_dynamic_dns_container_image_self_build_repo_branch: "{{ matrix_dynamic_dns_version }}"
# Config paths # Config paths
matrix_dynamic_dns_base_path: "{{ matrix_base_data_path }}/dynamic-dns" matrix_dynamic_dns_base_path: "{{ matrix_base_data_path }}/dynamic-dns"

@ -28,6 +28,7 @@
- name: Ensure Dynamic DNS repository is present on self build - name: Ensure Dynamic DNS repository is present on self build
ansible.builtin.git: ansible.builtin.git:
repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}" repo: "{{ matrix_dynamic_dns_container_image_self_build_repo }}"
version: "{{ matrix_dynamic_dns_container_image_self_build_repo_branch }}"
dest: "{{ matrix_dynamic_dns_docker_src_files_path }}" dest: "{{ matrix_dynamic_dns_docker_src_files_path }}"
force: "yes" force: "yes"
become: true become: true

@ -15,11 +15,13 @@
# #
- name: Ensure Jitsi internal authentication users are configured - name: Ensure Jitsi internal authentication users are configured
ansible.builtin.shell: "docker exec matrix-jitsi-prosody prosodyctl --config /config/prosody.cfg.lua register {{ item.username | quote }} meet.jitsi {{ item.password | quote }}" ansible.builtin.shell: "{{ matrix_host_command_docker }} exec matrix-jitsi-prosody prosodyctl --config /config/prosody.cfg.lua register {{ item.username | quote }} meet.jitsi {{ item.password | quote }}"
with_items: "{{ matrix_jitsi_prosody_auth_internal_accounts }}" with_items: "{{ matrix_jitsi_prosody_auth_internal_accounts }}"
when: when:
- matrix_jitsi_auth_type == "internal" - matrix_jitsi_auth_type == "internal"
- matrix_jitsi_prosody_auth_internal_accounts|length > 0 - matrix_jitsi_prosody_auth_internal_accounts|length > 0
register: matrix_jitsi_user_configuration_result
changed_when: matrix_jitsi_user_configuration_result.rc == 0
# #
# Tasks related to configuring other Jitsi authentication mechanisms # Tasks related to configuring other Jitsi authentication mechanisms

@ -90,9 +90,11 @@
register: matrix_ma1sd_git_pull_results register: matrix_ma1sd_git_pull_results
- name: Ensure ma1sd Docker image is built - name: Ensure ma1sd Docker image is built
ansible.builtin.shell: "DOCKER_BUILDKIT=1 ./gradlew dockerBuild" ansible.builtin.command:
args: cmd: ./gradlew dockerBuild
chdir: "{{ matrix_ma1sd_docker_src_files_path }}" chdir: "{{ matrix_ma1sd_docker_src_files_path }}"
environment:
DOCKER_BUILDKIT: 1
when: matrix_ma1sd_git_pull_results.changed when: matrix_ma1sd_git_pull_results.changed
- name: Ensure ma1sd Docker image is tagged correctly - name: Ensure ma1sd Docker image is tagged correctly

@ -51,6 +51,7 @@
{{ 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'
changed_when: true
- name: Delete temporary metrics password file - name: Delete temporary metrics password file
ansible.builtin.file: ansible.builtin.file:

@ -33,6 +33,7 @@
{{ matrix_postgres_docker_image_to_use }} {{ matrix_postgres_docker_image_to_use }}
-c -c
'psql -h {{ matrix_postgres_connection_hostname }} --file=/matrix-postgres-init-additional-db-user-and-role.sql' 'psql -h {{ matrix_postgres_connection_hostname }} --file=/matrix-postgres-init-additional-db-user-and-role.sql'
changed_when: true
- name: Delete additional database initialization SQL file for {{ additional_db.name }} - name: Delete additional database initialization SQL file for {{ additional_db.name }}
ansible.builtin.file: ansible.builtin.file:

@ -131,6 +131,8 @@
{{ matrix_postgres_pgloader_docker_image }} {{ matrix_postgres_pgloader_docker_image }}
-c -c
'pgloader {{ matrix_postgres_db_migration_request.pgloader_options | default([]) | join(' ') }} /in.db {{ matrix_postgres_db_migration_request.dst }}' 'pgloader {{ matrix_postgres_db_migration_request.pgloader_options | default([]) | join(' ') }} /in.db {{ matrix_postgres_db_migration_request.dst }}'
register: matrix_postgres_migrate_db_to_postgres_import_result
changed_when: matrix_postgres_migrate_db_to_postgres_import_result.rc == 0
- block: - block:
# We can't use `{{ role_path }}` here, neither with `import_tasks`, nor with `include_tasks`, # We can't use `{{ role_path }}` here, neither with `import_tasks`, nor with `include_tasks`,
@ -152,12 +154,16 @@
{{ matrix_postgres_docker_image_to_use }} {{ matrix_postgres_docker_image_to_use }}
psql --host=matrix-postgres --dbname={{ matrix_postgres_db_migration_request.additional_psql_statements_db_name }} --command='{{ item }}' psql --host=matrix-postgres --dbname={{ matrix_postgres_db_migration_request.additional_psql_statements_db_name }} --command='{{ item }}'
with_items: "{{ matrix_postgres_db_migration_request.additional_psql_statements_list }}" with_items: "{{ matrix_postgres_db_migration_request.additional_psql_statements_list }}"
register: matrix_postgres_migrate_db_to_postgres_additional_queries_result
changed_when: matrix_postgres_migrate_db_to_postgres_additional_queries_result.rc == 0
when: "matrix_postgres_db_migration_request.additional_psql_statements_list | default([])|length > 0" when: "matrix_postgres_db_migration_request.additional_psql_statements_list | default([])|length > 0"
- name: Archive {{ matrix_postgres_db_migration_request.engine_old }} database ({{ matrix_postgres_db_migration_request.src }} -> {{ matrix_postgres_db_migration_request.src }}.backup) - name: Archive {{ matrix_postgres_db_migration_request.engine_old }} database ({{ matrix_postgres_db_migration_request.src }} -> {{ matrix_postgres_db_migration_request.src }}.backup)
ansible.builtin.command: ansible.builtin.command:
cmd: "mv {{ matrix_postgres_db_migration_request.src }} {{ matrix_postgres_db_migration_request.src }}.backup" cmd: "mv {{ matrix_postgres_db_migration_request.src }} {{ matrix_postgres_db_migration_request.src }}.backup"
register: matrix_postgres_migrate_db_to_postgres_move_result
changed_when: matrix_postgres_migrate_db_to_postgres_move_result.rc == 0
- name: Inject result - name: Inject result
ansible.builtin.set_fact: ansible.builtin.set_fact:

@ -29,3 +29,5 @@
- name: Register user - name: Register user
ansible.builtin.command: "{{ matrix_local_bin_path }}/matrix-synapse-register-user {{ username|quote }} {{ password|quote }} {{ '1' if admin == 'yes' else '0' }}" ansible.builtin.command: "{{ matrix_local_bin_path }}/matrix-synapse-register-user {{ username|quote }} {{ password|quote }} {{ '1' if admin == 'yes' else '0' }}"
register: matrix_synapse_register_user_result
changed_when: matrix_synapse_register_user_result.rc == 0

@ -21,6 +21,7 @@
async: "{{ matrix_synapse_rust_synapse_compress_state_compress_room_time }}" async: "{{ matrix_synapse_rust_synapse_compress_state_compress_room_time }}"
poll: 10 poll: 10
register: matrix_synapse_rust_synapse_compress_state_compress_room_command_result register: matrix_synapse_rust_synapse_compress_state_compress_room_command_result
changed_when: matrix_synapse_rust_synapse_compress_state_compress_room_command_result.rc == 0
- ansible.builtin.debug: var="matrix_synapse_rust_synapse_compress_state_compress_room_command_result" - ansible.builtin.debug: var="matrix_synapse_rust_synapse_compress_state_compress_room_command_result"
@ -43,6 +44,7 @@
async: "{{ matrix_synapse_rust_synapse_compress_state_psql_import_time }}" async: "{{ matrix_synapse_rust_synapse_compress_state_psql_import_time }}"
poll: 10 poll: 10
register: matrix_synapse_rust_synapse_compress_state_psql_import_command_result register: matrix_synapse_rust_synapse_compress_state_psql_import_command_result
changed_when: matrix_synapse_rust_synapse_compress_state_psql_import_command_result.rc == 0
- name: Clean up - name: Clean up
ansible.builtin.file: ansible.builtin.file:

@ -70,6 +70,7 @@
async: "{{ matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time }}" async: "{{ matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time }}"
poll: 10 poll: 10
register: matrix_synapse_rust_synapse_compress_state_find_rooms_command_result register: matrix_synapse_rust_synapse_compress_state_find_rooms_command_result
changed_when: false
# We expect the output to be like this: # We expect the output to be like this:
# #

@ -32,6 +32,7 @@
- name: Check if Synapse Docker image exists - name: Check if Synapse Docker image exists
ansible.builtin.command: "{{ matrix_host_command_docker }} images --quiet --filter 'reference={{ matrix_synapse_docker_image }}'" ansible.builtin.command: "{{ matrix_host_command_docker }} images --quiet --filter 'reference={{ matrix_synapse_docker_image }}'"
register: matrix_synapse_docker_image_check_result register: matrix_synapse_docker_image_check_result
changed_when: false
# Invoking the `docker build` command here, instead of calling the `docker_image` Ansible module, # Invoking the `docker build` command here, instead of calling the `docker_image` Ansible module,
# because the latter does not support BuildKit. # because the latter does not support BuildKit.

@ -38,6 +38,9 @@
- name: Generate password hash - name: Generate password hash
ansible.builtin.shell: "{{ matrix_host_command_docker }} exec matrix-synapse /usr/local/bin/hash_password -c /data/homeserver.yaml -p {{ password|quote }}" ansible.builtin.shell: "{{ matrix_host_command_docker }} exec matrix-synapse /usr/local/bin/hash_password -c /data/homeserver.yaml -p {{ password|quote }}"
register: password_hash register: password_hash
changed_when: false
- name: Update user password hash - name: Update user password hash
ansible.builtin.command: "{{ matrix_local_bin_path }}/matrix-postgres-update-user-password-hash {{ username|quote }} {{ password_hash.stdout|quote }}" ansible.builtin.command: "{{ matrix_local_bin_path }}/matrix-postgres-update-user-password-hash {{ username|quote }} {{ password_hash.stdout|quote }}"
register: matrix_synapse_update_user_password_result
changed_when: matrix_synapse_update_user_password_result.rc == 0

Loading…
Cancel
Save