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: Iee65400016062ff06719d14dfa2da09a1f0b8ad0
This commit is contained in:
parent
b64f60c6ea
commit
c5ad57d456
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
- name: Stop services
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: "{{ item.service_name }}"
|
||||
enabled: true
|
||||
state: "stopped"
|
||||
@ -31,7 +31,7 @@
|
||||
- "cert installed"
|
||||
|
||||
- name: Start services
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: "{{ item.service_name }}"
|
||||
enabled: true
|
||||
state: "started"
|
||||
|
@ -14,13 +14,13 @@
|
||||
# limitations under the License.
|
||||
|
||||
- name: Perform a Glance DB sync
|
||||
command: "{{ glance_bin }}/glance-manage db_sync"
|
||||
ansible.builtin.command: "{{ glance_bin }}/glance-manage db_sync"
|
||||
become: true
|
||||
become_user: "{{ glance_system_user_name }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Load glance metadata definitions
|
||||
command: "{{ glance_bin }}/glance-manage db_load_metadefs {{ glance_etc_dir }}/metadefs"
|
||||
ansible.builtin.command: "{{ glance_bin }}/glance-manage db_load_metadefs {{ glance_etc_dir }}/metadefs"
|
||||
become: true
|
||||
become_user: "{{ glance_system_user_name }}"
|
||||
changed_when: false
|
||||
|
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
- name: Record the installation method
|
||||
ini_file:
|
||||
community.general.ini_file:
|
||||
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||
section: "glance"
|
||||
option: "install_method"
|
||||
@ -22,19 +22,19 @@
|
||||
mode: "0644"
|
||||
|
||||
- name: Refresh local facts to ensure the glance section is present
|
||||
setup:
|
||||
ansible.builtin.setup:
|
||||
filter: ansible_local
|
||||
gather_subset: "!all"
|
||||
|
||||
- name: Create the system group
|
||||
group:
|
||||
ansible.builtin.group:
|
||||
name: "{{ glance_system_group_name }}"
|
||||
gid: "{{ glance_system_group_gid | default(omit) }}"
|
||||
state: "present"
|
||||
system: "yes"
|
||||
|
||||
- name: Create the glance system user
|
||||
user:
|
||||
ansible.builtin.user:
|
||||
name: "{{ glance_system_user_name }}"
|
||||
uid: "{{ glance_system_user_uid | default(omit) }}"
|
||||
group: "{{ glance_system_group_name }}"
|
||||
@ -51,12 +51,12 @@
|
||||
- name: Source config block
|
||||
block:
|
||||
- name: Stat config directory
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ glance_etc_dir }}"
|
||||
register: glance_conf_dir_stat
|
||||
|
||||
- name: Remove the config directory
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ glance_etc_dir }}"
|
||||
state: absent
|
||||
when:
|
||||
@ -66,7 +66,7 @@
|
||||
- glance_install_method == 'source'
|
||||
|
||||
- name: Create glance directories
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path | default(omit) }}"
|
||||
src: "{{ item.src | default(omit) }}"
|
||||
dest: "{{ item.dest | default(omit) }}"
|
||||
@ -107,7 +107,7 @@
|
||||
mode: "0755"
|
||||
|
||||
- name: Install distro packages
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "{{ glance_package_list }}"
|
||||
state: "{{ glance_package_state }}"
|
||||
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
||||
@ -120,7 +120,7 @@
|
||||
- "Restart glance services"
|
||||
|
||||
- name: Install the python venv
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: "python_venv_build"
|
||||
vars:
|
||||
venv_python_executable: "{{ glance_venv_python_executable }}"
|
||||
@ -137,7 +137,7 @@
|
||||
when: glance_install_method == 'source'
|
||||
|
||||
- name: Run the systemd service role
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: systemd_service
|
||||
apply:
|
||||
tags:
|
||||
|
@ -68,7 +68,7 @@
|
||||
- glance-policy-override
|
||||
|
||||
- name: Remove legacy policy.yaml file
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ glance_etc_dir }}/{{ glance_policy_file }}"
|
||||
state: absent
|
||||
when:
|
||||
@ -93,7 +93,7 @@
|
||||
- Restart uwsgi services
|
||||
|
||||
- name: Deploy Glance image import configuration file
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ glance_glance_image_import_conf_location }}"
|
||||
dest: "{{ glance_etc_dir }}/glance-image-import.conf"
|
||||
mode: "0640"
|
||||
@ -108,13 +108,13 @@
|
||||
# because we only want to copy the original files once. and we
|
||||
# don't want to need multiple tasks.
|
||||
- name: Preserve original configuration file(s)
|
||||
command: "cp {{ item.target_f }} {{ item.target_f }}.original"
|
||||
ansible.builtin.command: "cp {{ item.target_f }} {{ item.target_f }}.original"
|
||||
args:
|
||||
creates: "{{ item.target_f }}.original"
|
||||
with_items: "{{ glance_core_files }}"
|
||||
|
||||
- name: Fetch override files
|
||||
fetch:
|
||||
ansible.builtin.fetch:
|
||||
src: "{{ item.target_f }}"
|
||||
dest: "{{ item.tmp_f }}"
|
||||
flat: true
|
||||
@ -138,7 +138,7 @@
|
||||
- Restart uwsgi services
|
||||
|
||||
- name: Cleanup fetched temp files
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.tmp_f }}"
|
||||
state: absent
|
||||
changed_when: false
|
||||
@ -148,7 +148,7 @@
|
||||
|
||||
# NOTE(cloudnull): This will ensure strong permissions on all rootwrap files.
|
||||
- name: Set rootwrap.d permissions
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ glance_etc_dir }}/rootwrap.d"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
@ -156,7 +156,7 @@
|
||||
recurse: true
|
||||
|
||||
- name: Run the systemd mount role
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: systemd_mount
|
||||
vars:
|
||||
systemd_mounts:
|
||||
@ -183,7 +183,7 @@
|
||||
- glance-config
|
||||
|
||||
- name: Create glance cache management cron jobs
|
||||
cron:
|
||||
ansible.builtin.cron:
|
||||
name: "{{ item.name }}"
|
||||
minute: "{{ 59 | random(seed=inventory_hostname, start=1) }}"
|
||||
day: "*"
|
||||
@ -200,7 +200,7 @@
|
||||
when: glance_flavor is search("cache")
|
||||
|
||||
- name: Drop sudoers file
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "sudoers.j2"
|
||||
dest: "/etc/sudoers.d/{{ glance_system_user_name }}_sudoers"
|
||||
mode: "0440"
|
||||
|
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
- name: Gather variables for each operating system
|
||||
include_vars: "{{ lookup('first_found', params) }}"
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
@ -29,7 +29,7 @@
|
||||
- always
|
||||
|
||||
- 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
|
||||
@ -39,12 +39,12 @@
|
||||
- ansible_local.openstack_ansible.glance.install_method != glance_install_method
|
||||
|
||||
- name: Gather variables for installation method
|
||||
include_vars: "{{ glance_install_method }}_install.yml"
|
||||
ansible.builtin.include_vars: "{{ glance_install_method }}_install.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: Including osa.db_setup role
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: openstack.osa.db_setup
|
||||
apply:
|
||||
tags:
|
||||
@ -66,7 +66,7 @@
|
||||
- always
|
||||
|
||||
- name: Including osa.mq_setup role
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: openstack.osa.mq_setup
|
||||
apply:
|
||||
tags:
|
||||
@ -93,12 +93,12 @@
|
||||
- always
|
||||
|
||||
- name: Importing glance_install tasks
|
||||
import_tasks: glance_install.yml
|
||||
ansible.builtin.import_tasks: glance_install.yml
|
||||
tags:
|
||||
- glance-install
|
||||
|
||||
- name: Create and install SSL certificates
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: pki
|
||||
tasks_from: main_certs.yml
|
||||
apply:
|
||||
@ -118,20 +118,20 @@
|
||||
- always
|
||||
|
||||
- name: Importing glance_post_install tasks
|
||||
import_tasks: glance_post_install.yml
|
||||
ansible.builtin.import_tasks: glance_post_install.yml
|
||||
tags:
|
||||
- glance-config
|
||||
- post-install
|
||||
|
||||
- name: Importing glance_db_sync tasks
|
||||
import_tasks: glance_db_sync.yml
|
||||
ansible.builtin.import_tasks: glance_db_sync.yml
|
||||
when:
|
||||
- "_glance_is_first_play_host"
|
||||
tags:
|
||||
- glance-config
|
||||
|
||||
- name: Including osa.service_setup role
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: openstack.osa.service_setup
|
||||
apply:
|
||||
tags:
|
||||
@ -168,7 +168,7 @@
|
||||
- always
|
||||
|
||||
- name: Import uwsgi role
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: uwsgi
|
||||
vars:
|
||||
uwsgi_services: "{{ uwsgi_glance_services }}"
|
||||
@ -179,7 +179,7 @@
|
||||
- uwsgi
|
||||
|
||||
- name: Import ceph_client role
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: ceph_client
|
||||
vars:
|
||||
openstack_service_system_user: "{{ glance_system_user_name }}"
|
||||
@ -191,4 +191,4 @@
|
||||
- ceph
|
||||
|
||||
- name: Flush handlers
|
||||
meta: flush_handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
Loading…
x
Reference in New Issue
Block a user