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: I609fd749e50b5c9f5b52d04ae2a566671c476720
This commit is contained in:
Dmitriy Rabotyagov 2025-02-12 14:25:48 +01:00
parent aed226f321
commit c6a2e94c5a
3 changed files with 15 additions and 15 deletions

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Gather variables for each operating system - name: Gather variables for each operating system
include_vars: "{{ item }}" ansible.builtin.include_vars: "{{ item }}"
with_first_found: with_first_found:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml" - "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml" - "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
@ -25,7 +25,7 @@
- always - always
- name: Including osa.db_setup role - name: Including osa.db_setup role
include_role: ansible.builtin.include_role:
name: openstack.osa.db_setup name: openstack.osa.db_setup
apply: apply:
tags: tags:
@ -45,12 +45,12 @@
- always - always
- name: Including rally_pre_install tasks - name: Including rally_pre_install tasks
include_tasks: rally_pre_install.yml ansible.builtin.include_tasks: rally_pre_install.yml
tags: tags:
- rally-install - rally-install
- name: Retrieve the constraints URL - name: Retrieve the constraints URL
uri: ansible.builtin.uri:
url: "{{ rally_upper_constraints_url }}" url: "{{ rally_upper_constraints_url }}"
return_content: true return_content: true
register: _u_c_contents_uri register: _u_c_contents_uri
@ -71,7 +71,7 @@
- skip_ansible_lint - skip_ansible_lint
- name: Set the constraints content - name: Set the constraints content
set_fact: ansible.builtin.set_fact:
_u_c_contents: |- _u_c_contents: |-
{% if _u_c_contents_uri is not skipped %} {% if _u_c_contents_uri is not skipped %}
{{ _u_c_contents_uri.content }} {{ _u_c_contents_uri.content }}
@ -80,7 +80,7 @@
{% endif %} {% endif %}
- name: Install the python venv - name: Install the python venv
import_role: ansible.builtin.import_role:
name: "python_venv_build" name: "python_venv_build"
vars: vars:
venv_python_executable: "{{ rally_venv_python_executable }}" venv_python_executable: "{{ rally_venv_python_executable }}"
@ -100,12 +100,12 @@
- rally-install - rally-install
- name: Including rally_post_install tasks - name: Including rally_post_install tasks
include_tasks: rally_post_install.yml ansible.builtin.include_tasks: rally_post_install.yml
tags: tags:
- rally-config - rally-config
- name: Including rally_db_setup tasks - name: Including rally_db_setup tasks
include_tasks: rally_db_setup.yml ansible.builtin.include_tasks: rally_db_setup.yml
when: inventory_hostname == groups['utility_all'][0] when: inventory_hostname == groups['utility_all'][0]
tags: tags:
- rally-config - rally-config

View File

@ -14,25 +14,25 @@
# limitations under the License. # limitations under the License.
- name: Check for db - name: Check for db
command: "{{ rally_bin }}/rally deployment list" ansible.builtin.command: "{{ rally_bin }}/rally deployment list"
changed_when: false changed_when: false
failed_when: false failed_when: false
register: rally_deployment_list_result register: rally_deployment_list_result
- name: Create/upgrade Rally DB schema - name: Create/upgrade Rally DB schema
command: "{{ rally_bin }}/rally db create" ansible.builtin.command: "{{ rally_bin }}/rally db create"
changed_when: false changed_when: false
when: when:
- rally_deployment_list_result.stdout is search("Database is missing") - rally_deployment_list_result.stdout is search("Database is missing")
- name: Check for existing Rally deployment - name: Check for existing Rally deployment
command: "{{ rally_bin }}/rally deployment list" ansible.builtin.command: "{{ rally_bin }}/rally deployment list"
changed_when: false changed_when: false
failed_when: false failed_when: false
register: rally_deployment_list_result register: rally_deployment_list_result
- name: Setup the Rally deployment - name: Setup the Rally deployment
shell: | ansible.builtin.shell: |
. /root/openrc . /root/openrc
. {{ rally_bin }}/activate . {{ rally_bin }}/activate
{{ rally_bin }}/rally deployment create --fromenv --name=existing {{ rally_bin }}/rally deployment create --fromenv --name=existing

View File

@ -14,13 +14,13 @@
# limitations under the License. # limitations under the License.
- name: Create the Rally system group - name: Create the Rally system group
group: ansible.builtin.group:
name: "{{ rally_system_group_name }}" name: "{{ rally_system_group_name }}"
state: "present" state: "present"
system: "yes" system: "yes"
- name: Create the Rally system user - name: Create the Rally system user
user: ansible.builtin.user:
name: "{{ rally_system_user_name }}" name: "{{ rally_system_user_name }}"
group: "{{ rally_system_group_name }}" group: "{{ rally_system_group_name }}"
comment: "{{ rally_system_user_comment }}" comment: "{{ rally_system_user_comment }}"
@ -30,7 +30,7 @@
home: "{{ rally_system_user_home }}" home: "{{ rally_system_user_home }}"
- name: Create Rally directories - name: Create Rally directories
file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: "directory" state: "directory"
owner: "{{ rally_system_user_name }}" owner: "{{ rally_system_user_name }}"