From b4a3b6269b774b843816b3120d59d558f6c7a4c9 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 12 Jul 2023 13:32:46 +0200 Subject: [PATCH] Fix linters and metadata With update of ansible-lint to version >=6.0.0 a lot of new linters were added, that enabled by default. In order to comply with linter rules we're applying changes to the role. With that we also update metdata to reflect current state. Change-Id: I63f6a2c803370736e969aa3a4dea3ea959316def --- defaults/main.yml | 9 +++++---- meta/main.yml | 10 ++++++---- tasks/install_apt.yml | 8 ++++++-- tasks/main.yml | 15 ++++++++++----- tasks/rabbitmq_cluster.yml | 2 +- tasks/rabbitmq_install.yml | 6 ++++-- tasks/rabbitmq_post_install.yml | 6 ++++-- tasks/rabbitmq_restart.yml | 6 ++++-- tasks/rabbitmq_upgrade_check.yml | 3 ++- tasks/rabbitmq_upgrade_prep.yml | 3 ++- 10 files changed, 44 insertions(+), 24 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fe5ab3d9..1d4f6c73 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -151,7 +151,8 @@ rabbitmq_pki_install_ca: rabbitmq_pki_keys_path: "{{ rabbitmq_pki_dir ~ '/certs/private/' }}" rabbitmq_pki_certs_path: "{{ rabbitmq_pki_dir ~ '/certs/certs/' }}" rabbitmq_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('RabbitMQIntermediate') }}" -rabbitmq_pki_intermediate_cert_path: "{{ rabbitmq_pki_dir ~ '/roots/' ~ rabbitmq_pki_intermediate_cert_name ~ '/certs/' ~ rabbitmq_pki_intermediate_cert_name ~ '.crt' }}" +rabbitmq_pki_intermediate_cert_path: >- + {{ rabbitmq_pki_dir ~ '/roots/' ~ rabbitmq_pki_intermediate_cert_name ~ '/certs/' ~ rabbitmq_pki_intermediate_cert_name ~ '.crt' }} rabbitmq_pki_regen_cert: '' rabbitmq_pki_certificates: - name: "rabbitmq_{{ ansible_facts['hostname'] }}" @@ -185,9 +186,9 @@ rabbitmq_pki_install_certificates: # Define user-provided SSL certificates in: # /etc/openstack_deploy/user_variables.yml -#rabbitmq_user_ssl_cert: -#rabbitmq_user_ssl_key: -#rabbitmq_user_ssl_ca_cert: +# rabbitmq_user_ssl_cert: +# rabbitmq_user_ssl_key: +# rabbitmq_user_ssl_ca_cert: # These are highly recommended for TLSv1.2 but cannot be used # with TLSv1.3. If TLSv1.3 is enabled, these lines will not be diff --git a/meta/main.yml b/meta/main.yml index 1bae9f4c..e5ccd805 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,18 +18,20 @@ galaxy_info: description: Install rabbitmq server company: Rackspace license: Apache2 - min_ansible_version: 2.0 + role_name: rabbitmq_server + namespace: openstack + min_ansible_version: "2.10" platforms: - name: Debian versions: - - buster + - bullseye - name: Ubuntu versions: - - bionic - focal + - jammy - name: EL versions: - - 8 + - "9" galaxy_tags: - cloud - rabbitmq diff --git a/tasks/install_apt.yml b/tasks/install_apt.yml index 6f60611d..bf1596af 100644 --- a/tasks/install_apt.yml +++ b/tasks/install_apt.yml @@ -82,10 +82,14 @@ filename: "{{ item.filename | default(omit) }}" update_cache: no with_items: - - repo: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] | lower }} main" + - repo: >- + deb https://packagecloud.io/rabbitmq/rabbitmq-server/{{ ansible_facts['distribution'] | lower }} + {{ ansible_facts['distribution_release'] | lower }} main filename: "{{ rabbitmq_repo.filename | default(omit) }}" condition: "{{ (rabbitmq_install_method == 'external_repo') }}" - - repo: "deb https://packages.erlang-solutions.com/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] | lower }} contrib" + - repo: >- + deb https://packages.erlang-solutions.com/{{ ansible_facts['distribution'] | lower }} + {{ ansible_facts['distribution_release'] | lower }} contrib filename: "{{ rabbitmq_erlang_repo.filename | default(omit) }}" condition: "{{ (rabbitmq_erlang_install_method == 'external_repo') }}" when: diff --git a/tasks/main.yml b/tasks/main.yml index a5b59f8c..d886800b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,12 +28,14 @@ tags: - always -- import_tasks: rabbitmq_pre_install.yml +- name: Importing rabbitmq_pre_install tasks + import_tasks: rabbitmq_pre_install.yml tags: - rabbitmq_server-install # The install process will be skipped if `rabbitmq_ignore_version_state=true` -- include_tasks: rabbitmq_install.yml +- name: Including rabbitmq_install tasks + include_tasks: rabbitmq_install.yml when: not rabbitmq_ignore_version_state | bool args: apply: @@ -59,17 +61,20 @@ pki_certificates: "{{ rabbitmq_pki_certificates }}" pki_install_certificates: "{{ rabbitmq_pki_install_certificates }}" -- import_tasks: rabbitmq_set_cookie.yml +- name: Importing rabbitmq_set_cookie tasks + import_tasks: rabbitmq_set_cookie.yml tags: - rabbitmq_server-config - rabbitmq-config -- import_tasks: rabbitmq_post_install.yml +- name: Importing rabbitmq_post_install tasks + import_tasks: rabbitmq_post_install.yml tags: - rabbitmq_server-config - rabbitmq-config -- import_tasks: rabbitmq_cluster.yml +- name: Importing rabbitmq_cluster tasks + import_tasks: rabbitmq_cluster.yml tags: - rabbitmq_server-config - rabbitmq-cluster diff --git a/tasks/rabbitmq_cluster.yml b/tasks/rabbitmq_cluster.yml index 18cf56df..75df2171 100644 --- a/tasks/rabbitmq_cluster.yml +++ b/tasks/rabbitmq_cluster.yml @@ -32,7 +32,7 @@ changed_when: false register: _cluster_name -- name: Set rabbitmq cluster name on primary node +- name: Set rabbitmq cluster name on primary node # noqa: no-changed-when command: | rabbitmqctl set_cluster_name {{ rabbitmq_cluster_name }} when: diff --git a/tasks/rabbitmq_install.yml b/tasks/rabbitmq_install.yml index ccd91a4e..e2971a45 100644 --- a/tasks/rabbitmq_install.yml +++ b/tasks/rabbitmq_install.yml @@ -13,9 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -- import_tasks: rabbitmq_upgrade_check.yml +- name: Importing rabbitmq_upgrade_check tasks + import_tasks: rabbitmq_upgrade_check.yml -- include_tasks: "install_{{ ansible_facts['pkg_mgr'] }}.yml" +- name: Including install tasks + include_tasks: "install_{{ ansible_facts['pkg_mgr'] }}.yml" args: apply: tags: diff --git a/tasks/rabbitmq_post_install.yml b/tasks/rabbitmq_post_install.yml index 4eb51069..d690c2e2 100644 --- a/tasks/rabbitmq_post_install.yml +++ b/tasks/rabbitmq_post_install.yml @@ -66,7 +66,8 @@ tags: - rabbitmq-config -- include_tasks: +- name: Including rabbitmq_restart tasks + include_tasks: file: rabbitmq_restart.yml apply: tags: rabbitmq-config @@ -88,7 +89,8 @@ - rabbitmq-config - rabbitmq-cluster -- include_tasks: +- name: Including rabbitmq_restart tasks + include_tasks: file: rabbitmq_restart.yml apply: tags: rabbitmq-config diff --git a/tasks/rabbitmq_restart.yml b/tasks/rabbitmq_restart.yml index 5ac12584..c640233e 100644 --- a/tasks/rabbitmq_restart.yml +++ b/tasks/rabbitmq_restart.yml @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include_tasks: rabbitmq_stopped.yml +- name: Including rabbitmq_stopped tasks + include_tasks: rabbitmq_stopped.yml args: apply: tags: @@ -21,7 +22,8 @@ tags: - always -- include_tasks: rabbitmq_started.yml +- name: Including rabbitmq_started tasks + include_tasks: rabbitmq_started.yml args: apply: tags: diff --git a/tasks/rabbitmq_upgrade_check.yml b/tasks/rabbitmq_upgrade_check.yml index cb5ee567..8d39491b 100644 --- a/tasks/rabbitmq_upgrade_check.yml +++ b/tasks/rabbitmq_upgrade_check.yml @@ -69,7 +69,8 @@ - rabbitmq-package-rpm - rabbitmq-apt-packages -- include_tasks: rabbitmq_upgrade_prep.yml +- name: Including rabbitmq_upgrade_prep tasks + include_tasks: rabbitmq_upgrade_prep.yml args: apply: tags: diff --git a/tasks/rabbitmq_upgrade_prep.yml b/tasks/rabbitmq_upgrade_prep.yml index cc983fbd..234eb2f9 100644 --- a/tasks/rabbitmq_upgrade_prep.yml +++ b/tasks/rabbitmq_upgrade_prep.yml @@ -23,7 +23,8 @@ - rabbitmq-policy-file - rabbitmq-upgrade -- include_tasks: rabbitmq_stopped.yml +- name: Including rabbitmq_stopped tasks + include_tasks: rabbitmq_stopped.yml - name: Ensure erlang epmd is stopped shell: |