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: I1558d4bd0d6d45262338d0056dc063fdef156cbe
This commit is contained in:
Dmitriy Rabotyagov
2025-02-12 14:30:51 +01:00
parent 2d3c7f2db0
commit 3aa37b2876
7 changed files with 35 additions and 35 deletions

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Stop services - name: Stop services
service: ansible.builtin.service:
name: "{{ item.service_name }}" name: "{{ item.service_name }}"
enabled: true enabled: true
state: "stopped" state: "stopped"
@@ -28,7 +28,7 @@
- "venv changed" - "venv changed"
- name: Start services - name: Start services
service: ansible.builtin.service:
name: "{{ item.service_name }}" name: "{{ item.service_name }}"
enabled: true enabled: true
state: "started" state: "started"

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: "{{ lookup('first_found', params) }}" ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars: vars:
params: params:
files: files:
@@ -30,7 +30,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:
@@ -52,29 +52,29 @@
- always - always
- name: Importing skyline_pre_install tasks - name: Importing skyline_pre_install tasks
import_tasks: skyline_pre_install.yml ansible.builtin.import_tasks: skyline_pre_install.yml
tags: tags:
- skyline-install - skyline-install
- name: Importing skyline_install tasks - name: Importing skyline_install tasks
import_tasks: skyline_install.yml ansible.builtin.import_tasks: skyline_install.yml
tags: tags:
- skyline-install - skyline-install
- name: Importing skyline_post_install tasks - name: Importing skyline_post_install tasks
import_tasks: skyline_post_install.yml ansible.builtin.import_tasks: skyline_post_install.yml
tags: tags:
- skyline-config - skyline-config
- post-install - post-install
- name: Importing skyline_db_sync tasks - name: Importing skyline_db_sync tasks
import_tasks: skyline_db_sync.yml ansible.builtin.import_tasks: skyline_db_sync.yml
when: _skyline_is_first_play_host when: _skyline_is_first_play_host
tags: tags:
- skyline-config - skyline-config
- name: Including openstack.osa.service_setup role - name: Including openstack.osa.service_setup role
include_role: ansible.builtin.include_role:
name: openstack.osa.service_setup name: openstack.osa.service_setup
apply: apply:
tags: tags:
@@ -99,4 +99,4 @@
- always - always
- name: Flush handlers - name: Flush handlers
meta: flush_handlers ansible.builtin.meta: flush_handlers

View File

@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Perform a skyline DB sync - name: Perform a skyline DB sync
command: "{{ skyline_bin }}/alembic -c {{ skyline_lib_dir }}/skyline_apiserver/db/alembic/alembic.ini upgrade head" ansible.builtin.command: "{{ skyline_bin }}/alembic -c {{ skyline_lib_dir }}/skyline_apiserver/db/alembic/alembic.ini upgrade head"
become: true become: true
become_user: "{{ skyline_system_user_name }}" become_user: "{{ skyline_system_user_name }}"
changed_when: false changed_when: false

View File

@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Install distro packages - name: Install distro packages
package: ansible.builtin.package:
name: "{{ skyline_package_list }}" name: "{{ skyline_package_list }}"
state: "{{ skyline_package_state }}" state: "{{ skyline_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
@@ -25,14 +25,14 @@
delay: 2 delay: 2
- name: Build skyline-console with yarn - name: Build skyline-console with yarn
include_tasks: ansible.builtin.include_tasks:
file: skyline_install_yarn.yml file: skyline_install_yarn.yml
when: when:
- skyline_console_wheel_build_enable | ternary(_skyline_is_first_play_host, True) - skyline_console_wheel_build_enable | ternary(_skyline_is_first_play_host, True)
- skyline_console_yarn_build - skyline_console_yarn_build
- 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: "{{ skyline_venv_python_executable }}" venv_python_executable: "{{ skyline_venv_python_executable }}"
@@ -52,7 +52,7 @@
value: "{{ skyline_venv_tag }}" value: "{{ skyline_venv_tag }}"
- name: Run the systemd service role - name: Run the systemd service role
include_role: ansible.builtin.include_role:
name: systemd_service name: systemd_service
vars: vars:
systemd_user_name: "{{ skyline_system_user_name }}" systemd_user_name: "{{ skyline_system_user_name }}"

View File

@@ -19,7 +19,7 @@
- ansible_facts['os_family'] | lower == 'redhat' - ansible_facts['os_family'] | lower == 'redhat'
block: block:
- name: Download EPEL gpg keys - name: Download EPEL gpg keys
get_url: ansible.builtin.get_url:
url: "{{ skyline_yarn_epel_key }}" url: "{{ skyline_yarn_epel_key }}"
dest: /etc/pki/rpm-gpg dest: /etc/pki/rpm-gpg
mode: "0640" mode: "0640"
@@ -29,12 +29,12 @@
delay: 2 delay: 2
- name: Install EPEL gpg keys - name: Install EPEL gpg keys
rpm_key: ansible.builtin.rpm_key:
key: "/etc/pki/rpm-gpg/{{ skyline_yarn_epel_key.split('/')[-1] }}" key: "/etc/pki/rpm-gpg/{{ skyline_yarn_epel_key.split('/')[-1] }}"
state: present state: present
- name: Install the EPEL repository - name: Install the EPEL repository
yum_repository: ansible.builtin.yum_repository:
name: epel-yarn name: epel-yarn
baseurl: "{{ skyline_yarn_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}" baseurl: "{{ skyline_yarn_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: "NodeJS Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch" description: "NodeJS Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
@@ -49,7 +49,7 @@
- name: Clone skyline repo to the destination - name: Clone skyline repo to the destination
delegate_to: "{{ skyline_console_yarn_setup_host }}" delegate_to: "{{ skyline_console_yarn_setup_host }}"
git: ansible.builtin.git:
repo: "{{ skyline_console_git_repo }}" repo: "{{ skyline_console_git_repo }}"
version: "{{ skyline_console_git_install_branch }}" version: "{{ skyline_console_git_install_branch }}"
dest: "{{ skyline_console_yarn_build_path }}" dest: "{{ skyline_console_yarn_build_path }}"
@@ -64,7 +64,7 @@
# due to missing setuptools and pip. If it happens - we consider need # due to missing setuptools and pip. If it happens - we consider need
# of building yarn # of building yarn
- name: Get intended version to be installed - name: Get intended version to be installed
command: python3 setup.py --version ansible.builtin.command: python3 setup.py --version
args: args:
chdir: "{{ skyline_console_yarn_build_path }}" chdir: "{{ skyline_console_yarn_build_path }}"
register: __skyline_console_candidate register: __skyline_console_candidate
@@ -74,7 +74,7 @@
# NOTE(noonedeadpunk): We check for wheels, as venv might have something different installed # NOTE(noonedeadpunk): We check for wheels, as venv might have something different installed
# while wheels might be already in place. # while wheels might be already in place.
- name: Check if required wheel is already present - name: Check if required wheel is already present
uri: ansible.builtin.uri:
url: >- url: >-
{{ openstack_repo_url | default('http://localhost') }}/os-releases/{{ openstack_release | default('master') }}/{{ {{ openstack_repo_url | default('http://localhost') }}/os-releases/{{ openstack_release | default('master') }}/{{
_venv_build_dist_arch }}/wheels/skyline_console-{{ __skyline_console_candidate.stdout_lines[-1] }}-py3-none-any.whl _venv_build_dist_arch }}/wheels/skyline_console-{{ __skyline_console_candidate.stdout_lines[-1] }}-py3-none-any.whl
@@ -86,7 +86,7 @@
- __skyline_console_candidate is not changed - __skyline_console_candidate is not changed
- name: Check if installed in the venv version matches - name: Check if installed in the venv version matches
command: >- ansible.builtin.command: >-
{{ skyline_bin }}/{{ skyline_venv_python_executable }} -c "from importlib.metadata import version; print(version('skyline-console'))" {{ skyline_bin }}/{{ skyline_venv_python_executable }} -c "from importlib.metadata import version; print(version('skyline-console'))"
register: __skyline_console_venv register: __skyline_console_venv
changed_when: __skyline_console_venv.rc in [1, 127] or __skyline_console_candidate.stdout_lines[-1] != __skyline_console_venv.stdout_lines[-1] changed_when: __skyline_console_venv.rc in [1, 127] or __skyline_console_candidate.stdout_lines[-1] != __skyline_console_venv.stdout_lines[-1]
@@ -95,7 +95,7 @@
- __skyline_console_candidate is not changed - __skyline_console_candidate is not changed
- name: Define if we should re-build with yarn - name: Define if we should re-build with yarn
set_fact: ansible.builtin.set_fact:
skyline_console_yarn_rebuild: true skyline_console_yarn_rebuild: true
when: when:
- __skyline_console_candidate is changed or __skyline_console_wheels is changed or __skyline_console_venv is changed - __skyline_console_candidate is changed or __skyline_console_wheels is changed or __skyline_console_venv is changed
@@ -105,7 +105,7 @@
when: skyline_console_yarn_rebuild when: skyline_console_yarn_rebuild
block: block:
- name: Install yarn - name: Install yarn
package: ansible.builtin.package:
name: "{{ skyline_yarn_packages }}" name: "{{ skyline_yarn_packages }}"
state: "{{ skyline_package_state }}" state: "{{ skyline_package_state }}"
register: install_packages register: install_packages
@@ -114,7 +114,7 @@
delay: 2 delay: 2
- name: Install yarn requirements (this may take a while) - name: Install yarn requirements (this may take a while)
command: "{{ skyline_yarn_binary }} install" ansible.builtin.command: "{{ skyline_yarn_binary }} install"
args: args:
chdir: "{{ skyline_console_yarn_build_path }}" chdir: "{{ skyline_console_yarn_build_path }}"
register: install_yarn register: install_yarn
@@ -124,7 +124,7 @@
changed_when: false changed_when: false
- name: Build skyline-console static files (this may take a while) - name: Build skyline-console static files (this may take a while)
command: "{{ skyline_yarn_binary }} run build" ansible.builtin.command: "{{ skyline_yarn_binary }} run build"
args: args:
chdir: "{{ skyline_console_yarn_build_path }}" chdir: "{{ skyline_console_yarn_build_path }}"
changed_when: false changed_when: false

View File

@@ -17,17 +17,17 @@
when: skyline_lib_dir is not defined when: skyline_lib_dir is not defined
block: block:
- name: Find the venv's python version - name: Find the venv's python version
command: >- ansible.builtin.command: >-
{{ skyline_bin }}/{{ skyline_venv_python_executable }} -c 'import skyline_apiserver; print(skyline_apiserver.__file__)' {{ skyline_bin }}/{{ skyline_venv_python_executable }} -c 'import skyline_apiserver; print(skyline_apiserver.__file__)'
changed_when: false changed_when: false
register: _skyline_python_venv_details register: _skyline_python_venv_details
- name: Set python lib dir fact - name: Set python lib dir fact
set_fact: ansible.builtin.set_fact:
skyline_lib_dir: "{{ _skyline_python_venv_details.stdout | dirname | dirname }}" skyline_lib_dir: "{{ _skyline_python_venv_details.stdout | dirname | dirname }}"
- name: Create gunicorn config - name: Create gunicorn config
template: ansible.builtin.template:
src: "gunicorn.py.j2" src: "gunicorn.py.j2"
dest: "/etc/skyline/gunicorn.py" dest: "/etc/skyline/gunicorn.py"
owner: "root" owner: "root"
@@ -54,7 +54,7 @@
- Restart skyline services - Restart skyline services
- name: Get OpenStack endpoints - name: Get OpenStack endpoints
command: >- ansible.builtin.command: >-
openstack --os-cloud default endpoint list --format yaml --interface {{ skyline_interface }} openstack --os-cloud default endpoint list --format yaml --interface {{ skyline_interface }}
delegate_to: "{{ skyline_service_setup_host }}" delegate_to: "{{ skyline_service_setup_host }}"
register: _endpoint_list register: _endpoint_list
@@ -62,8 +62,8 @@
changed_when: false changed_when: false
- name: Set endpoint fact - name: Set endpoint fact
set_fact: ansible.builtin.set_fact:
openstack_service_endpoints: "{{ _endpoint_list.stdout | from_yaml }}" openstack_service_endpoints: "{{ _endpoint_list.stdout | from_yaml }}"
- name: Importing web server configuration tasks - name: Importing web server configuration tasks
import_tasks: skyline_apache.yml ansible.builtin.import_tasks: skyline_apache.yml

View File

@@ -14,14 +14,14 @@
# limitations under the License. # limitations under the License.
- name: Create the system group - name: Create the system group
group: ansible.builtin.group:
name: "{{ skyline_system_group_name }}" name: "{{ skyline_system_group_name }}"
gid: "{{ skyline_system_group_gid | default(omit) }}" gid: "{{ skyline_system_group_gid | default(omit) }}"
state: "present" state: "present"
system: "yes" system: "yes"
- name: Create the skyline system user - name: Create the skyline system user
user: ansible.builtin.user:
name: "{{ skyline_system_user_name }}" name: "{{ skyline_system_user_name }}"
uid: "{{ skyline_system_user_uid | default(omit) }}" uid: "{{ skyline_system_user_uid | default(omit) }}"
group: "{{ skyline_system_group_name }}" group: "{{ skyline_system_group_name }}"
@@ -32,7 +32,7 @@
home: "{{ skyline_system_user_home }}" home: "{{ skyline_system_user_home }}"
- name: Create skyline dir - name: Create skyline dir
file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: directory state: directory
owner: "{{ item.owner | default(skyline_system_user_name) }}" owner: "{{ item.owner | default(skyline_system_user_name) }}"