More ansible-lint fixes
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
---
 | 
			
		||||
- ansible.builtin.set_fact:
 | 
			
		||||
    matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dimension.service'] }}"
 | 
			
		||||
  when: matrix_dimension_enabled|bool
 | 
			
		||||
  when: matrix_dimension_enabled | bool
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,23 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
 | 
			
		||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
 | 
			
		||||
  tags:
 | 
			
		||||
    - always
 | 
			
		||||
 | 
			
		||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
 | 
			
		||||
  when: run_setup|bool
 | 
			
		||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
 | 
			
		||||
  when: run_setup | bool
 | 
			
		||||
  tags:
 | 
			
		||||
    - setup-all
 | 
			
		||||
    - setup-dimension
 | 
			
		||||
 | 
			
		||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
 | 
			
		||||
  when: run_setup|bool and matrix_dimension_enabled|bool
 | 
			
		||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
 | 
			
		||||
  when: run_setup | bool and matrix_dimension_enabled | bool
 | 
			
		||||
  tags:
 | 
			
		||||
    - setup-all
 | 
			
		||||
    - setup-dimension
 | 
			
		||||
 | 
			
		||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
 | 
			
		||||
  when: run_setup|bool and not matrix_dimension_enabled|bool
 | 
			
		||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
 | 
			
		||||
  when: run_setup | bool and not matrix_dimension_enabled | bool
 | 
			
		||||
  tags:
 | 
			
		||||
    - setup-all
 | 
			
		||||
    - setup-dimension
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
 | 
			
		||||
- block:
 | 
			
		||||
    - name: Check if an SQLite database already exists
 | 
			
		||||
      stat:
 | 
			
		||||
      ansible.builtin.stat:
 | 
			
		||||
        path: "{{ matrix_dimension_sqlite_database_path_local }}"
 | 
			
		||||
      register: matrix_dimension_sqlite_database_path_local_stat_result
 | 
			
		||||
 | 
			
		||||
@@ -53,7 +53,7 @@
 | 
			
		||||
            matrix_postgres_db_migration_request:
 | 
			
		||||
              src: "{{ matrix_dimension_sqlite_database_path_local }}"
 | 
			
		||||
              dst: "{{ matrix_dimension_database_connection_string }}"
 | 
			
		||||
              caller: "{{ role_path|basename }}"
 | 
			
		||||
              caller: "{{ role_path | basename }}"
 | 
			
		||||
              engine_variable_name: 'matrix_dimension_database_engine'
 | 
			
		||||
              engine_old: 'sqlite'
 | 
			
		||||
              systemd_services_to_stop: ['matrix-dimension.service']
 | 
			
		||||
@@ -61,11 +61,11 @@
 | 
			
		||||
              additional_psql_statements_list: "{{ matrix_dimension_pgloader_additional_psql_statements_list }}"
 | 
			
		||||
              additional_psql_statements_db_name: "{{ matrix_dimension_database_name }}"
 | 
			
		||||
 | 
			
		||||
        - import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
 | 
			
		||||
        - ansible.builtin.import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
 | 
			
		||||
 | 
			
		||||
        - ansible.builtin.set_fact:
 | 
			
		||||
            matrix_dimension_requires_restart: true
 | 
			
		||||
      when: "matrix_dimension_sqlite_database_path_local_stat_result.stat.exists|bool"
 | 
			
		||||
      when: "matrix_dimension_sqlite_database_path_local_stat_result.stat.exists | bool"
 | 
			
		||||
  when: "matrix_dimension_database_engine == 'postgres'"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Dimension base path exists
 | 
			
		||||
@@ -78,7 +78,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Ensure Dimension config installed
 | 
			
		||||
  ansible.builtin.copy:
 | 
			
		||||
    content: "{{ matrix_dimension_configuration|to_nice_yaml(indent=2, width=999999) }}"
 | 
			
		||||
    content: "{{ matrix_dimension_configuration | to_nice_yaml(indent=2, width=999999) }}"
 | 
			
		||||
    dest: "{{ matrix_dimension_base_path }}/config.yaml"
 | 
			
		||||
    mode: 0640
 | 
			
		||||
    owner: "{{ matrix_user_username }}"
 | 
			
		||||
@@ -90,7 +90,7 @@
 | 
			
		||||
    source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
 | 
			
		||||
    force_source: "{{ matrix_dimension_docker_image_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_dimension_docker_image_force_pull }}"
 | 
			
		||||
  when: "not matrix_dimension_container_image_self_build|bool"
 | 
			
		||||
  when: "not matrix_dimension_container_image_self_build | bool"
 | 
			
		||||
  register: matrix_dimension_pull_results
 | 
			
		||||
  retries: "{{ matrix_container_retries_count }}"
 | 
			
		||||
  delay: "{{ matrix_container_retries_delay }}"
 | 
			
		||||
@@ -104,7 +104,7 @@
 | 
			
		||||
    force: "yes"
 | 
			
		||||
  become: true
 | 
			
		||||
  become_user: "{{ matrix_user_username }}"
 | 
			
		||||
  when: "matrix_dimension_container_image_self_build|bool"
 | 
			
		||||
  when: "matrix_dimension_container_image_self_build | bool"
 | 
			
		||||
  register: matrix_dimension_git_pull_results
 | 
			
		||||
 | 
			
		||||
- name: Ensure Dimension Docker image is built
 | 
			
		||||
@@ -117,7 +117,7 @@
 | 
			
		||||
      dockerfile: Dockerfile
 | 
			
		||||
      path: "{{ matrix_dimension_docker_src_files_path }}"
 | 
			
		||||
      pull: true
 | 
			
		||||
  when: "matrix_dimension_container_image_self_build|bool"
 | 
			
		||||
  when: "matrix_dimension_container_image_self_build | bool"
 | 
			
		||||
 | 
			
		||||
- name: Ensure matrix-dimension.service installed
 | 
			
		||||
  ansible.builtin.template:
 | 
			
		||||
@@ -129,10 +129,10 @@
 | 
			
		||||
- name: Ensure systemd reloaded after matrix-dimension.service installation
 | 
			
		||||
  ansible.builtin.service:
 | 
			
		||||
    daemon_reload: true
 | 
			
		||||
  when: "matrix_dimension_systemd_service_result.changed|bool"
 | 
			
		||||
  when: "matrix_dimension_systemd_service_result.changed | bool"
 | 
			
		||||
 | 
			
		||||
- name: Ensure matrix-dimension.service restarted, if necessary
 | 
			
		||||
  ansible.builtin.service:
 | 
			
		||||
    name: "matrix-dimension.service"
 | 
			
		||||
    state: restarted
 | 
			
		||||
  when: "matrix_dimension_requires_restart|bool"
 | 
			
		||||
  when: "matrix_dimension_requires_restart | bool"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- name: Check existence of matrix-dimension service
 | 
			
		||||
  stat:
 | 
			
		||||
  ansible.builtin.stat:
 | 
			
		||||
    path: "{{ matrix_systemd_path }}/matrix-dimension.service"
 | 
			
		||||
  register: matrix_dimension_service_stat
 | 
			
		||||
 | 
			
		||||
@@ -12,18 +12,18 @@
 | 
			
		||||
    enabled: false
 | 
			
		||||
    daemon_reload: true
 | 
			
		||||
  register: stopping_result
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists|bool"
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists | bool"
 | 
			
		||||
 | 
			
		||||
- name: Ensure matrix-dimension.service doesn't exist
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
    path: "{{ matrix_systemd_path }}/matrix-dimension.service"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists|bool"
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists | bool"
 | 
			
		||||
 | 
			
		||||
- name: Ensure systemd reloaded after matrix-dimension.service removal
 | 
			
		||||
  ansible.builtin.service:
 | 
			
		||||
    daemon_reload: true
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists|bool"
 | 
			
		||||
  when: "matrix_dimension_service_stat.stat.exists | bool"
 | 
			
		||||
 | 
			
		||||
- name: Ensure Dimension base directory doesn't exist
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user