Fix linters issues

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.

This is a follow-up change to [1].

[1] https://review.opendev.org/c/openstack/openstack-ansible-lxc_hosts/+/888180

Change-Id: I2564e3dcb2efad8f6a2ed21bec61668c1b6f6209
This commit is contained in:
Dmitriy Rabotyagov 2023-08-22 13:24:46 +02:00
parent 4686fac862
commit 2272de8f0c
2 changed files with 26 additions and 23 deletions

View File

@ -131,11 +131,16 @@ lxc_kernel_options:
- { key: 'fs.inotify.max_user_instances', value: 1024 } - { key: 'fs.inotify.max_user_instances', value: 1024 }
lxc_cache_sshd_configuration: lxc_cache_sshd_configuration:
- { regexp: "^PermitRootLogin", line: "PermitRootLogin prohibit-password" } - regexp: "^PermitRootLogin"
- { regexp: "^TCPKeepAlive", line: "TCPKeepAlive yes" } line: "PermitRootLogin prohibit-password"
- { regexp: "^UseDNS", line: "UseDNS no" } - regexp: "^TCPKeepAlive"
- { regexp: "^X11Forwarding", line: "X11Forwarding no" } line: "TCPKeepAlive yes"
- { regexp: "^PasswordAuthentication", line: "PasswordAuthentication no" } - regexp: "^UseDNS"
line: "UseDNS no"
- regexp: "^X11Forwarding"
line: "X11Forwarding no"
- regexp: "^PasswordAuthentication"
line: "PasswordAuthentication no"
# The compression ratio used when creating the container cache rootfs archive # The compression ratio used when creating the container cache rootfs archive
lxc_image_compression_ratio: 0 lxc_image_compression_ratio: 0
@ -236,7 +241,8 @@ lxc_cache_locales: "{{ _lxc_cache_locales | default(['en_US.UTF-8']) }}"
# Centos EPEL repository options # Centos EPEL repository options
lxc_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}" lxc_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}"
lxc_centos_epel_key: "{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_facts['distribution_major_version']) }}" lxc_centos_epel_key: >-
{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_facts['distribution_major_version']) }}
# LXC must be installed from a COPR repository on CentOS since the version # LXC must be installed from a COPR repository on CentOS since the version
# provided in EPEL is much too old (1.x). # provided in EPEL is much too old (1.x).

View File

@ -24,9 +24,6 @@
name: "apparmor" name: "apparmor"
state: "restarted" state: "restarted"
- name: Init reload
command: "initctl reload-configuration"
- name: Restart importd - name: Restart importd
systemd: systemd:
name: "systemd-importd.service" name: "systemd-importd.service"
@ -40,7 +37,7 @@
daemon_reload: yes daemon_reload: yes
- name: Bring bridge up - name: Bring bridge up
command: "ip link set {{ lxc_net_bridge }} up" command: "ip link set {{ lxc_net_bridge }} up" # noqa: no-changed-when
- name: Reload systemd units - name: Reload systemd units
systemd: systemd: