Auto-fix usage of modules via FQCN

Since ansible-core 2.10 it is recommended to use modules via FQCN
In order to align with recommendation, we perform migration
by applying suggestions made by `ansible-lint --fix=fqcn`

Change-Id: I3106f13014a3f99cefcd07ccf31a0c79f2977805
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 14:19:21 +01:00
parent b176f7523b
commit 4cb54be737
8 changed files with 38 additions and 38 deletions

View File

@ -14,7 +14,7 @@
# limitations under the License.
- name: Restart octavia services
service:
ansible.builtin.service:
name: "{{ item.service_name }}"
state: "restarted"
with_items: "{{ filtered_octavia_services }}"

View File

@ -14,7 +14,7 @@
# limitations under the License.
- name: Fail if service was deployed using a different installation method
fail:
ansible.builtin.fail:
msg: "Switching installation methods for OpenStack services is not supported"
when:
- ansible_local is defined
@ -24,7 +24,7 @@
- ansible_local.openstack_ansible.octavia.install_method != octavia_install_method
- name: Gather variables for each operating system
include_vars: "{{ lookup('first_found', params) }}"
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
@ -39,12 +39,12 @@
- always
- name: Gather variables for installation method
include_vars: "{{ octavia_install_method }}_install.yml"
ansible.builtin.include_vars: "{{ octavia_install_method }}_install.yml"
tags:
- always
- name: Fail if our required secrets are not present
fail:
ansible.builtin.fail:
msg: "Please set the {{ item }} variable prior to applying this role."
when: (item is undefined) or (item is none)
with_items: "{{ octavia_required_secrets }}"
@ -52,7 +52,7 @@
- always
- name: Including osa.db_setup role
include_role:
ansible.builtin.include_role:
name: openstack.osa.db_setup
apply:
tags:
@ -79,7 +79,7 @@
- always
- name: Including osa.mq_setup role
include_role:
ansible.builtin.include_role:
name: openstack.osa.mq_setup
apply:
tags:
@ -105,17 +105,17 @@
- always
- name: Gather variables for installation method
include_vars: "{{ octavia_install_method }}_install.yml"
ansible.builtin.include_vars: "{{ octavia_install_method }}_install.yml"
tags:
- always
- name: Importing octavia_pre_install tasks
import_tasks: octavia_pre_install.yml
ansible.builtin.import_tasks: octavia_pre_install.yml
tags:
- octavia-install
- name: Create and install SSL certificates
include_role:
ansible.builtin.include_role:
name: pki
apply:
tags:
@ -137,7 +137,7 @@
- always
- name: Assemble SSL certificates
assemble:
ansible.builtin.assemble:
src: /etc/octavia/certs/
dest: /etc/octavia/certs/client.pem
regexp: "(client\\.pem\\.crt|client\\.pem\\.key)$"
@ -154,12 +154,12 @@
- octavia-install
- name: Importing octavia_install tasks
import_tasks: octavia_install.yml
ansible.builtin.import_tasks: octavia_install.yml
tags:
- octavia-install
- name: Import uwsgi role
import_role:
ansible.builtin.import_role:
name: uwsgi
vars:
uwsgi_services: "{{ uwsgi_octavia_services }}"
@ -169,7 +169,7 @@
- uwsgi
- name: Run the systemd service role
import_role:
ansible.builtin.import_role:
name: systemd_service
vars:
systemd_after_targets: "{{ service_var.after_targets | default(['syslog.target', 'network.target']) }}"
@ -188,7 +188,7 @@
- systemd-service
- name: Including osa.service_setup role
include_role:
ansible.builtin.include_role:
name: openstack.osa.service_setup
apply:
tags:
@ -229,7 +229,7 @@
- always
- name: Including octavia_resources tasks
include_tasks: octavia_resources.yml
ansible.builtin.include_tasks: octavia_resources.yml
args:
apply:
tags:
@ -242,25 +242,25 @@
- octavia-resources
- name: Importing octavia_post_install tasks
import_tasks: octavia_post_install.yml
ansible.builtin.import_tasks: octavia_post_install.yml
tags:
- octavia-install
- octavia-config
- post-install
- name: Importing octavia_db_sync tasks
import_tasks: octavia_db_sync.yml
ansible.builtin.import_tasks: octavia_db_sync.yml
when:
- _octavia_is_first_play_host
tags:
- octavia-install
- name: Importing octavia_policy tasks
import_tasks: octavia_policy.yml
ansible.builtin.import_tasks: octavia_policy.yml
tags:
- octavia-install
- octavia-config
- octavia-policy-override
- name: Flush handlers
meta: flush_handlers
ansible.builtin.meta: flush_handlers

View File

@ -14,13 +14,13 @@
# limitations under the License.
- name: Perform a octavia DB sync
command: "{{ octavia_bin }}/octavia-db-manage upgrade head"
ansible.builtin.command: "{{ octavia_bin }}/octavia-db-manage upgrade head"
become: true
become_user: "{{ octavia_system_user_name }}"
changed_when: false
- name: Perform a octavia DB sync
command: "{{ octavia_bin }}/octavia-db-manage upgrade_persistence"
ansible.builtin.command: "{{ octavia_bin }}/octavia-db-manage upgrade_persistence"
become: true
become_user: "{{ octavia_system_user_name }}"
changed_when: false

View File

@ -1,6 +1,6 @@
---
- name: Record the installation method
ini_file:
community.general.ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: "octavia"
option: "install_method"
@ -8,12 +8,12 @@
mode: "0644"
- name: Refresh local facts to ensure the octavia section is present
setup:
ansible.builtin.setup:
filter: ansible_local
gather_subset: "!all"
- name: Install distro packages
package:
ansible.builtin.package:
name: "{{ octavia_package_list }}"
state: "{{ octavia_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
@ -24,7 +24,7 @@
delay: 2
- name: Install the python venv
import_role:
ansible.builtin.import_role:
name: "python_venv_build"
vars:
venv_python_executable: "{{ octavia_venv_python_executable }}"

View File

@ -25,7 +25,7 @@
- (octavia_policy_overrides | length > 0) or (octavia_legacy_policy | bool)
- name: Remove legacy policy.yaml file
file:
ansible.builtin.file:
path: "/etc/octavia/policy.yaml"
state: absent
when:

View File

@ -16,7 +16,7 @@
# iptables module doesn't see empty string as a null value so this is the only
# way to get a configurable rule definition in right now
- name: IPtables rules
iptables: "{{ item }}"
ansible.builtin.iptables: "{{ item }}"
with_items: "{{ octavia_iptables_rules }}"
when: octavia_ip_tables_fw | bool
@ -24,19 +24,19 @@
# in the distro does) they return 1; but do their job. If you run them
# directly they work. Ignoring errors for now --
- name: Save iptables rules (Debian/Ubuntu)
command: netfilter-persistent save
ansible.builtin.command: netfilter-persistent save
changed_when: false
failed_when: false
when: ansible_facts['os_family'] == 'Debian'
- name: Save iptables rules (CentOS)
shell: iptables-save > /etc/sysconfig/iptables
ansible.builtin.shell: iptables-save > /etc/sysconfig/iptables
changed_when: false
when:
- ansible_facts['distribution'] == 'CentOS'
- name: Copy user provided HAProxy templates
copy:
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ octavia_system_user_name }}"
@ -69,7 +69,7 @@
retries: 5
- name: Set Octavia flavor UUID fact
set_fact:
ansible.builtin.set_fact:
octavia_nova_flavor_uuid: "{{ get_flavor_info.flavors[0].id }}"
- name: Set octavia_neutron_management_network_uuid if it is not already set
@ -99,7 +99,7 @@
delay: 10
- name: Set Octavia management network UUID fact
set_fact:
ansible.builtin.set_fact:
octavia_neutron_management_network_uuid: "{{ get_net_info.networks[0].id }}"
- name: Set octavia_amp_image_owner_id if it is not already set
@ -128,7 +128,7 @@
delay: 10
- name: Set Octavia amp image owner UUID fact
set_fact:
ansible.builtin.set_fact:
octavia_amp_image_owner_id: "{{ get_project_info.projects[0].id }}"
- name: Drop octavia Config(s)

View File

@ -14,13 +14,13 @@
# limitations under the License.
- name: Create the system group
group:
ansible.builtin.group:
name: "{{ octavia_system_group_name }}"
state: "present"
system: "yes"
- name: Create the octavia system user
user:
ansible.builtin.user:
name: "{{ octavia_system_user_name }}"
group: "{{ octavia_system_group_name }}"
comment: "{{ octavia_system_comment }}"
@ -30,7 +30,7 @@
home: "{{ octavia_system_home_folder }}"
- name: Create octavia dir
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner | default(octavia_system_user_name) }}"

View File

@ -15,7 +15,7 @@
- name: Create image download directory
delegate_to: "{{ octavia_service_setup_host }}"
file:
ansible.builtin.file:
path: "{{ octavia_amp_image_path }}"
state: directory
mode: "0750"