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
This commit is contained in:
Dmitriy Rabotyagov 2023-07-12 13:32:46 +02:00
parent 2fc53a3a03
commit b4a3b6269b
10 changed files with 44 additions and 24 deletions

View File

@ -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: <path to cert on ansible deployment host>
#rabbitmq_user_ssl_key: <path to cert on ansible deployment host>
#rabbitmq_user_ssl_ca_cert: <path to cert on ansible deployment host>
# rabbitmq_user_ssl_cert: <path to cert on ansible deployment host>
# rabbitmq_user_ssl_key: <path to cert on ansible deployment host>
# rabbitmq_user_ssl_ca_cert: <path to cert on ansible deployment host>
# These are highly recommended for TLSv1.2 but cannot be used
# with TLSv1.3. If TLSv1.3 is enabled, these lines will not be

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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: |