Fix linters issue 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: Ide0ca8cf60f3a92c98543465d53bc4720067b153
This commit is contained in:
Dmitriy Rabotyagov 2023-07-13 13:58:50 +02:00 committed by Dmitriy Rabotyagov
parent f1de9887b5
commit 3cf5320038
12 changed files with 71 additions and 37 deletions

View File

@ -168,7 +168,8 @@ openstack_hosts_rdo_repo_type: trunk
openstack_hosts_rdo_mirror_url: 'https://trunk.rdoproject.org' openstack_hosts_rdo_mirror_url: 'https://trunk.rdoproject.org'
openstack_hosts_rdo_repo_url: "{{ _openstack_hosts_rdo_repo_url }}" openstack_hosts_rdo_repo_url: "{{ _openstack_hosts_rdo_repo_url }}"
openstack_hosts_rdo_deps_url: "{{ _openstack_hosts_rdo_deps_url }}" openstack_hosts_rdo_deps_url: "{{ _openstack_hosts_rdo_deps_url }}"
openstack_hosts_power_tool_enable: "{{ ('repo_all' in groups or 'manila_all' in groups or 'gnocchi_all' in groups or install_method | default('source') == 'distro') }}" openstack_hosts_power_tool_enable: >-
{{ ('repo_all' in groups or 'manila_all' in groups or 'gnocchi_all' in groups or install_method | default('source') == 'distro') }}
# Keep a history of systemd journals on disk after reboots # Keep a history of systemd journals on disk after reboots
openstack_host_keep_journals: yes openstack_host_keep_journals: yes

View File

@ -18,19 +18,21 @@ galaxy_info:
description: Base host setup for a OpenStack Private Cloud host description: Base host setup for a OpenStack Private Cloud host
company: Rackspace company: Rackspace
license: Apache2 license: Apache2
min_ansible_version: 2.9 role_name: openstack_hosts
namespace: openstack
min_ansible_version: "2.10"
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- buster - bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- bionic
- focal - focal
- jammy
- name: EL - name: EL
versions: versions:
- 8 - "9"
categories: galaxy_tags:
- cloud - cloud
- host - host
- development - development

View File

@ -42,7 +42,7 @@
retries: 5 retries: 5
delay: 2 delay: 2
- name: check how kernel modules are implemented (statically builtin, dynamic, not set) - name: Check how kernel modules are implemented (statically builtin, dynamic, not set)
slurp: slurp:
src: "/boot/config-{{ ansible_facts['kernel'] }}" src: "/boot/config-{{ ansible_facts['kernel'] }}"
register: modules register: modules
@ -69,6 +69,7 @@
template: template:
src: modprobe.conf.j2 src: modprobe.conf.j2
dest: "{{ openstack_host_module_file }}" dest: "{{ openstack_host_module_file }}"
mode: "0644"
- name: Adding new system tuning - name: Adding new system tuning
sysctl: sysctl:
@ -89,6 +90,9 @@
file: file:
path: /var/log/journal path: /var/log/journal
state: directory state: directory
owner: root
group: systemd-journal
mode: "2755"
register: journald_directory register: journald_directory
when: when:
- openstack_host_keep_journals | bool - openstack_host_keep_journals | bool

View File

@ -32,11 +32,13 @@
file: file:
path: /etc/ansible/facts.d/ path: /etc/ansible/facts.d/
state: directory state: directory
mode: "0755"
tags: tags:
- openstack_hosts-install - openstack_hosts-install
# Deploy the release file everywhere # Deploy the release file everywhere
- import_tasks: openstack_release.yml - name: Importing openstack_release tasks
import_tasks: openstack_release.yml
tags: tags:
- openstack_hosts-install - openstack_hosts-install
@ -104,7 +106,8 @@
include_tasks: "openstack_hosts_configure_{{ ansible_facts['pkg_mgr'] | lower }}.yml" include_tasks: "openstack_hosts_configure_{{ ansible_facts['pkg_mgr'] | lower }}.yml"
# Configure bare metal nodes: Kernel, sysctl, sysstat, hosts files, metal packages # Configure bare metal nodes: Kernel, sysctl, sysstat, hosts files, metal packages
- include_tasks: configure_metal_hosts.yml - name: Including configure_metal_hosts tasks
include_tasks: configure_metal_hosts.yml
args: args:
apply: apply:
tags: tags:
@ -145,11 +148,13 @@
retries: 5 retries: 5
delay: 2 delay: 2
- import_tasks: openstack_authorized_keys.yml - name: Importing openstack_authorized_keys tasks
import_tasks: openstack_authorized_keys.yml
tags: tags:
- openstack_hosts-config - openstack_hosts-config
- include_role: - name: Including PKI role
include_role:
name: pki name: pki
tasks_from: main_ca_install.yml tasks_from: main_ca_install.yml
vars: vars:
@ -158,19 +163,25 @@
tags: tags:
- always - always
- include_tasks: openstack_gitconfig.yml - name: Including openstack_gitconfig tasks
include_tasks: openstack_gitconfig.yml
args: args:
apply: apply:
tags: tags:
- openstack_hosts-config - openstack_hosts-config
when: ansible_facts['hostname'] != 'aio1' when: ansible_facts['hostname'] != 'aio1'
- include_tasks: openstack_hosts_systemd.yml - name: Including openstack_hosts_systemd tasks
include_tasks: openstack_hosts_systemd.yml
args: args:
apply: apply:
tags: tags:
- openstack_hosts-config - openstack_hosts-config
- openstack_hosts-systemd - openstack_hosts-systemd
when: openstack_hosts_systemd_networkd_devices or openstack_hosts_systemd_networkd_networks or openstack_hosts_systemd_services or openstack_hosts_systemd_mounts when:
- openstack_hosts_systemd_networkd_devices or
openstack_hosts_systemd_networkd_networks or
openstack_hosts_systemd_services or
openstack_hosts_systemd_mounts
tags: tags:
- always - always

View File

@ -33,4 +33,5 @@
template: template:
src: gitconfig.j2 src: gitconfig.j2
dest: /etc/gitconfig dest: /etc/gitconfig
mode: "0644"
when: _git_version.rc != 0 when: _git_version.rc != 0

View File

@ -77,6 +77,7 @@
copy: copy:
content: "{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}" content: "{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}"
dest: /etc/apt/apt.conf.d/99openstack-ansible dest: /etc/apt/apt.conf.d/99openstack-ansible
mode: "0644"
when: when:
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0 - openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0

View File

@ -25,6 +25,7 @@
option: enabled option: enabled
value: "{{ (openstack_hosts_enable_yum_fastestmirror | bool) | ternary('1', '0') }}" value: "{{ (openstack_hosts_enable_yum_fastestmirror | bool) | ternary('1', '0') }}"
no_extra_spaces: yes no_extra_spaces: yes
mode: "0644"
when: when:
- fastestmirror_plugin_check.stat.exists - fastestmirror_plugin_check.stat.exists
@ -98,6 +99,7 @@
path: /etc/dnf/dnf.conf path: /etc/dnf/dnf.conf
marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK" marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK"
create: yes create: yes
mode: "0644"
when: when:
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0 - openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0
@ -105,6 +107,7 @@
get_url: get_url:
url: "{{ openstack_hosts_rdo_repo_url }}/delorean.repo" url: "{{ openstack_hosts_rdo_repo_url }}/delorean.repo"
dest: /etc/yum.repos.d/rdo.repo dest: /etc/yum.repos.d/rdo.repo
mode: "0640"
register: _get_repo register: _get_repo
until: _get_repo is success until: _get_repo is success
retries: 5 retries: 5

View File

@ -25,6 +25,7 @@
option: enabled option: enabled
value: "{{ (openstack_hosts_enable_yum_fastestmirror | bool) | ternary('1', '0') }}" value: "{{ (openstack_hosts_enable_yum_fastestmirror | bool) | ternary('1', '0') }}"
no_extra_spaces: yes no_extra_spaces: yes
mode: "0644"
when: when:
- fastestmirror_plugin_check.stat.exists - fastestmirror_plugin_check.stat.exists
@ -96,5 +97,6 @@
path: /etc/yum.conf path: /etc/yum.conf
marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK" marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK"
create: yes create: yes
mode: "0644"
when: when:
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0 - openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0

View File

@ -19,6 +19,7 @@
dest: "{{ openstack_distrib_file_path }}" dest: "{{ openstack_distrib_file_path }}"
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0644"
when: when:
- openstack_distrib_file | bool - openstack_distrib_file | bool

View File

@ -83,10 +83,14 @@ _package_list:
_osbpo_release: "zed" _osbpo_release: "zed"
_package_repos: _package_repos:
- repo: "deb {{ apt_repo_url | default('http://osbpo.debian.net/osbpo/ ' ~ ansible_facts['distribution_release'] ~ '-' ~ _osbpo_release ~ '-backports main') }}" - repo: >-
deb {{ apt_repo_url | default('http://osbpo.debian.net/osbpo/ ' ~ ansible_facts['distribution_release'] ~ '-' ~ _osbpo_release ~ '-backports main') }}
state: present state: present
filename: "osbpo" filename: "osbpo"
- repo: "deb {{ apt_repo_url | default('http://osbpo.debian.net/osbpo/ ' ~ ansible_facts['distribution_release'] ~ '-' ~ _osbpo_release ~ '-backports-nochange main') }}" - repo: >-
deb {{ apt_repo_url | default(
'http://osbpo.debian.net/osbpo/ ' ~ ansible_facts['distribution_release'] ~ '-' ~ _osbpo_release ~ '-backports-nochange main'
) }}
state: present state: present
filename: "osbpo" filename: "osbpo"

View File

@ -89,8 +89,10 @@ _package_list:
- name: ca-certificates - name: ca-certificates
state: latest state: latest
_openstack_hosts_rdo_repo_url: "{{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/current/" _openstack_hosts_rdo_repo_url: >-
_openstack_hosts_rdo_deps_url: "{{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/deps/latest/" {{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/current/
_openstack_hosts_rdo_deps_url: >-
{{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/deps/latest/
_package_repos_trunk: _package_repos_trunk:
- name: rdo-deps - name: rdo-deps

View File

@ -87,7 +87,9 @@ _package_list:
state: latest state: latest
_package_repos: _package_repos:
- repo: "deb {{ apt_repo_url | default('http://ubuntu-cloud.archive.canonical.com/ubuntu') }} {{ ansible_facts['lsb']['codename'] }}-updates/{{ openstack_distrib_code_name | lower }} main" - repo: >-
deb {{ apt_repo_url | default('http://ubuntu-cloud.archive.canonical.com/ubuntu') }}
{{ ansible_facts['lsb']['codename'] }}-updates/{{ openstack_distrib_code_name | lower }} main
state: present state: present
filename: "uca" filename: "uca"