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: I9815ced69afb6f79de53f864669d77ce48bebe2f
This commit is contained in:
Dmitriy Rabotyagov
2025-02-13 09:59:17 +01:00
parent 3fa0c33ed3
commit 1ed0c4a644
15 changed files with 94 additions and 94 deletions

View File

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

View File

@@ -14,19 +14,19 @@
# limitations under the License.
- name: Create cephkeys_access_group group
group:
ansible.builtin.group:
name: "{{ cephkeys_access_group }}"
- name: Including ceph_get_keyrings_from_mons tasks
include_tasks: ceph_get_keyrings_from_mons.yml
ansible.builtin.include_tasks: ceph_get_keyrings_from_mons.yml
when: ceph_keyrings_dir is not defined
- name: Including ceph_get_keyrings_from_files tasks
include_tasks: ceph_get_keyrings_from_files.yml
ansible.builtin.include_tasks: ceph_get_keyrings_from_files.yml
when: ceph_keyrings_dir is defined
- name: Add OpenStack service to cephkeys_access_group group
user:
ansible.builtin.user:
name: "{{ openstack_service_system_user }}"
groups: "{{ cephkeys_access_group }}"
append: true
@@ -34,13 +34,13 @@
- Restart os services
- name: Make sure libvirt is started
service:
ansible.builtin.service:
name: "{{ libvirt_service_name }}"
state: "started"
when: inventory_hostname in groups.nova_compute
- name: Check if nova secret is defined in libvirt
shell: virsh secret-list|grep {{ nova_ceph_client_uuid }}
ansible.builtin.shell: virsh secret-list|grep {{ nova_ceph_client_uuid }}
when:
- inventory_hostname in groups.nova_compute
changed_when: false
@@ -50,7 +50,7 @@
- always
- name: Provide xml file to create the secret
template:
ansible.builtin.template:
src: secret.xml.j2
dest: /tmp/nova-secret.xml
mode: "0600"
@@ -65,7 +65,7 @@
- always
- name: Define libvirt nova secret
command: virsh secret-define --file /tmp/nova-secret.xml # noqa: no-changed-when
ansible.builtin.command: virsh secret-define --file /tmp/nova-secret.xml # noqa: no-changed-when
when:
- inventory_hostname in groups.nova_compute
- libvirt_nova_defined.rc is defined
@@ -76,7 +76,7 @@
- always
- name: Check if nova secret value is set in libvirt
command: virsh secret-get-value {{ nova_ceph_client_uuid }}
ansible.builtin.command: virsh secret-get-value {{ nova_ceph_client_uuid }}
when:
- inventory_hostname in groups.nova_compute
- ceph_nova_secret is defined
@@ -87,7 +87,7 @@
- always
- name: Set nova secret value in libvirt
command: virsh secret-set-value --secret {{ nova_ceph_client_uuid }} --base64 {{ ceph_nova_secret.stdout }}
ansible.builtin.command: virsh secret-set-value --secret {{ nova_ceph_client_uuid }} --base64 {{ ceph_nova_secret.stdout }}
changed_when: false
when:
- inventory_hostname in groups.nova_compute
@@ -101,7 +101,7 @@
- ceph-config
- name: Remove libvirt nova secret file
file:
ansible.builtin.file:
path: "/tmp/nova-secret.xml"
state: "absent"
when:
@@ -110,7 +110,7 @@
- always
- name: Detect correct group for extra auth
set_fact:
ansible.builtin.set_fact:
ceph_in_extra_auth_group: true
with_items: "{{ ceph_extra_auth_groups }}"
when:
@@ -118,13 +118,13 @@
- inventory_hostname in groups[item]
- name: Including ceph_auth_extra tasks
include_tasks: ceph_auth_extra.yml
ansible.builtin.include_tasks: ceph_auth_extra.yml
when:
- ceph_in_extra_auth_group is defined
- ceph_in_extra_auth_group | bool
- name: Detect extra nova uuid secret
set_fact:
ansible.builtin.set_fact:
ceph_extra_nova_uuid: true
with_items: "{{ ceph_extra_confs | default([]) }}"
when:
@@ -132,7 +132,7 @@
- item.secret_uuid is defined
- name: Including ceph_auth_extra_compute tasks
include_tasks: ceph_auth_extra_compute.yml
ansible.builtin.include_tasks: ceph_auth_extra_compute.yml
when:
- ceph_extra_nova_uuid is defined
- ceph_extra_nova_uuid | bool

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create keyring files for openstack clients from extra cluster(s)
shell: >-
ansible.builtin.shell: >-
ceph auth get client.{{ item.client_name }} --cluster {{ ceph_cluster_name }} >/dev/null &&
ceph auth get-or-create client.{{ item.client_name }} --cluster {{ ceph_cluster_name }}
> /etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.keyring.tmp
@@ -25,7 +25,7 @@
- item.mon_host is defined
- name: Get extra keyring files
command: "scp {{ item.mon_host }}:/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.keyring.tmp {{ item.keyring_src }}"
ansible.builtin.command: "scp {{ item.mon_host }}:/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.keyring.tmp {{ item.keyring_src }}"
changed_when: false
delegate_to: localhost
with_items: "{{ ceph_extra_confs }}"
@@ -35,7 +35,7 @@
- item.client_name is defined
- name: Secure extra keyring file permissions
file:
ansible.builtin.file:
path: "{{ item.keyring_src }}"
state: file
mode: "0600"
@@ -45,7 +45,7 @@
- item.keyring_src is defined
- name: Remove temp extra keyring files
file:
ansible.builtin.file:
path: "/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.keyring.tmp"
state: absent
delegate_to: "{{ item.mon_host }}"
@@ -56,7 +56,7 @@
- item.client_name is defined
- name: Create extra keyring files
copy:
ansible.builtin.copy:
src: "{{ item.keyring_src }}"
dest: "{{ item.keyring_dest }}"
owner: root

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create key files for nova_compute on extra cluster(s)
shell: >-
ansible.builtin.shell: >-
ceph auth get-key client.{{ item.client_name }} --cluster {{ ceph_cluster_name }}
> /etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.key.tmp
with_items: "{{ ceph_extra_confs }}"
@@ -24,7 +24,7 @@
- item.mon_host is defined
- name: Get extra key files
command: >-
ansible.builtin.command: >-
scp {{ item.mon_host }}:/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.key.tmp
/tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp
changed_when: false
@@ -35,7 +35,7 @@
- item.client_name is defined
- name: Distribute extra key files from monitor host
copy:
ansible.builtin.copy:
src: "/tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp"
dest: "/tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp"
mode: "0640"
@@ -45,7 +45,7 @@
- item.client_name is defined
- name: Create extra key files from keyring files
copy:
ansible.builtin.copy:
src: "{{ item.keyring_src }}"
dest: "/tmp/{{ item.secret_uuid }}{{ item.client_name }}.key.tmp"
mode: "0640"
@@ -56,7 +56,7 @@
- item.secret_uuid is defined
- name: Remove temp extra key files
file:
ansible.builtin.file:
path: "/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.client_name }}.key.tmp"
state: absent
delegate_to: "{{ item.mon_host }}"
@@ -67,7 +67,7 @@
- item.client_name is defined
- name: Provide extra xml files to create the secrets
template:
ansible.builtin.template:
src: secret.xml.j2
dest: /tmp/{{ item.secret_uuid }}{{ item.client_name }}-secret.xml
mode: "0600"
@@ -77,7 +77,7 @@
- item.secret_uuid is defined
- name: Check if extra secret(s) are defined in libvirt pt1
shell: "virsh secret-dumpxml {{ item.secret_uuid }} 2>&1 >/dev/null && touch /tmp/{{ item.secret_uuid }}.libvirt_secret_exists"
ansible.builtin.shell: "virsh secret-dumpxml {{ item.secret_uuid }} 2>&1 >/dev/null && touch /tmp/{{ item.secret_uuid }}.libvirt_secret_exists"
changed_when: false
failed_when: false
with_items: "{{ ceph_extra_confs }}"
@@ -87,7 +87,7 @@
- always
- name: Check if extra secret(s) are defined in libvirt pt2
shell: "ls /tmp | grep \\.libvirt_secret_exists | awk -F'.' '{print $1}'"
ansible.builtin.shell: "ls /tmp | grep \\.libvirt_secret_exists | awk -F'.' '{print $1}'"
changed_when: false
failed_when: false
register: libvirt_secret_exists
@@ -98,7 +98,7 @@
- always
- name: Define libvirt nova extra secret(s)
command: "virsh secret-define --file /tmp/{{ item.secret_uuid }}{{ item.client_name }}-secret.xml"
ansible.builtin.command: "virsh secret-define --file /tmp/{{ item.secret_uuid }}{{ item.client_name }}-secret.xml"
changed_when: false
loop: "{{ ceph_extra_confs }}"
loop_control:
@@ -111,7 +111,7 @@
- Restart os services
- name: Check if extra secret values are set in libvirt pt1
shell: "virsh secret-get-value {{ item.secret_uuid }} 2>&1 >/dev/null && touch /tmp/{{ item.secret_uuid }}.libvirt_secret_value_exists "
ansible.builtin.shell: "virsh secret-get-value {{ item.secret_uuid }} 2>&1 >/dev/null && touch /tmp/{{ item.secret_uuid }}.libvirt_secret_value_exists "
changed_when: false
failed_when: false
register: libvirt_nova_set
@@ -120,7 +120,7 @@
- item.secret_uuid is defined
- name: Check if extra secret values are set in libvirt pt2
shell: "ls /tmp | grep \\.libvirt_secret_value_exists | awk -F'.' '{print $1}'"
ansible.builtin.shell: "ls /tmp | grep \\.libvirt_secret_value_exists | awk -F'.' '{print $1}'"
changed_when: false
failed_when: false
register: libvirt_secret_value_exists
@@ -131,7 +131,7 @@
- always
- name: Set extra secret value(s) in libvirt from monitor host # noqa: no-changed-when
shell: "virsh secret-set-value --secret {{ item.secret_uuid }} --base64 $(cat /tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp)"
ansible.builtin.shell: "virsh secret-set-value --secret {{ item.secret_uuid }} --base64 $(cat /tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp)"
loop: "{{ ceph_extra_confs }}"
loop_control:
index_var: index
@@ -144,7 +144,7 @@
- Restart os services
- name: Set extra secret value(s) in libvirt from keyring # noqa: no-changed-when
shell: >-
ansible.builtin.shell: >-
virsh secret-set-value --secret {{ item.secret_uuid }} --base64
$(awk '/key = /{print $3}' /tmp/{{ item.secret_uuid }}{{ item.client_name }}.key.tmp)
loop: "{{ ceph_extra_confs }}"
@@ -160,7 +160,7 @@
# Cleanup temp files
- name: Remove libvirt nova secret detection file
file:
ansible.builtin.file:
path: "/tmp/{{ item.secret_uuid }}.libvirt_secret_exists"
state: "absent"
with_items: "{{ ceph_extra_confs }}"
@@ -170,7 +170,7 @@
- always
- name: Remove libvirt nova secret value detection file
file:
ansible.builtin.file:
path: "/tmp/{{ item.secret_uuid }}.libvirt_secret_value_exists"
state: "absent"
with_items: "{{ ceph_extra_confs }}"
@@ -180,7 +180,7 @@
- always
- name: Remove libvirt nova secret file
file:
ansible.builtin.file:
path: "/tmp/{{ item.secret_uuid }}{{ item.client_name }}-secret.xml"
state: "absent"
with_items: "{{ ceph_extra_confs }}"
@@ -191,7 +191,7 @@
- always
- name: Remove libvirt key file from monitor host
file:
ansible.builtin.file:
path: "/tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp"
state: "absent"
with_items: "{{ ceph_extra_confs }}"
@@ -202,7 +202,7 @@
- always
- name: Remove libvirt key file from keyring
file:
ansible.builtin.file:
path: "/tmp/{{ item.secret_uuid }}{{ item.client_name }}.key.tmp"
state: "absent"
with_items: "{{ ceph_extra_confs }}"
@@ -213,7 +213,7 @@
- always
- name: Remove libvirt key file localhost
file:
ansible.builtin.file:
path: "/tmp/{{ item.mon_host }}{{ item.client_name }}.key.tmp"
state: "absent"
delegate_to: localhost

View File

@@ -14,7 +14,7 @@
# limitations under the License.
- name: Provide ceph configuration directory
file:
ansible.builtin.file:
dest: /etc/ceph
state: directory
owner: root
@@ -22,7 +22,7 @@
mode: "0755"
- name: Get ceph.conf and store contents when ceph_conf_file is not defined
slurp:
ansible.builtin.slurp:
src: "/etc/ceph/{{ ceph_cluster_name }}.conf"
register: ceph_conf_content_mon
delegate_to: "{{ ceph_mon_host }}"
@@ -31,13 +31,13 @@
- ceph_conf_file is not defined
- name: Register ceph_conf fact when ceph_conf_file is not defined
set_fact:
ansible.builtin.set_fact:
ceph_conf: "{{ ceph_conf_content_mon.content | b64decode }}"
when:
- ceph_conf_file is not defined
- name: Register ceph_conf fact when ceph_conf_file is defined
set_fact:
ansible.builtin.set_fact:
ceph_conf: "{{ ceph_conf_file }}\n\n"
when:
- ceph_conf_file is defined
@@ -55,7 +55,7 @@
- Restart os services
- name: Detect correct group for extra config
set_fact:
ansible.builtin.set_fact:
ceph_in_extra_config_group: true
when:
- ceph_extra_confs is defined
@@ -63,7 +63,7 @@
with_items: "{{ ceph_extra_config_groups }}"
- name: Including ceph_config_extra tasks
include_tasks: ceph_config_extra.yml
ansible.builtin.include_tasks: ceph_config_extra.yml
when:
- ceph_in_extra_config_group is defined
- ceph_in_extra_config_group | bool

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Get extra ceph.conf files
command: "scp {{ item.mon_host }}:/etc/ceph/{{ item.cluster_name | default(ceph_cluster_name) }}.conf {{ item.src }}"
ansible.builtin.command: "scp {{ item.mon_host }}:/etc/ceph/{{ item.cluster_name | default(ceph_cluster_name) }}.conf {{ item.src }}"
changed_when: false
delegate_to: localhost
with_items: "{{ ceph_extra_confs }}"
@@ -22,7 +22,7 @@
- item.src is defined
- name: Create extra ceph.conf files
copy:
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
@@ -36,7 +36,7 @@
- item.dest is defined
- name: Add keyring section to extra ceph.conf files
ini_file:
community.general.ini_file:
dest: "{{ item.dest }}"
section: "client.{{ item.client_name }}"
option: keyring

View File

@@ -16,7 +16,7 @@
## Ceph client keyrings
- name: From files | Retrieve keyrings for openstack clients
set_fact:
ansible.builtin.set_fact:
ceph_client_keys: |-
{% set _keys = {} %}
{% for client in ceph_client_filtered_clients %}
@@ -34,7 +34,7 @@
- always
- name: From files | Provision ceph client keyrings
copy:
ansible.builtin.copy:
dest: "/etc/ceph/{{ ceph_cluster_name }}.client.{{ item['name'] }}.keyring"
content: |
{{ ceph_client_keys[item['name']] }}
@@ -52,7 +52,7 @@
- Restart os services
- name: From file | Retrieve nova secret
set_fact:
ansible.builtin.set_fact:
ceph_nova_secret:
stdout: "{{ (ceph_client_keys[nova_ceph_client] | regex_search('.*^\\s*key\\s*=\\s*(.*)$.*', '\\1', multiline=True))[0] }}"
when:

View File

@@ -20,7 +20,7 @@
# the first get makes sure the client exists, so the second only runs when it
# exists, the trick is the different output of both, the second has the right
# output to put in a keyring; ceph admin should have already created the user
shell: >-
ansible.builtin.shell: >-
ceph auth get client.{{ item['name'] }} --cluster {{ ceph_cluster_name }} >/dev/null &&
ceph auth get-or-create client.{{ item['name'] }} --cluster {{ ceph_cluster_name }}
with_items: "{{ ceph_client_filtered_clients }}"
@@ -36,7 +36,7 @@
- name: Provision ceph client keyrings
# TODO: do we really need a template for this? what's the added value compare to
# ceph get-or-create ... ... -o file?
template:
ansible.builtin.template:
src: ceph.client.keyring.j2
dest: "/etc/ceph/{{ ceph_cluster_name }}.client.{{ item.item['name'] }}.keyring"
backup: true
@@ -58,7 +58,7 @@
## Ceph nova client libvirt secret
- name: Retrieve nova secret from cephcluster
command: ceph auth get-key client.{{ nova_ceph_client }} --cluster {{ ceph_cluster_name }}
ansible.builtin.command: ceph auth get-key client.{{ nova_ceph_client }} --cluster {{ ceph_cluster_name }}
when:
- inventory_hostname in groups.nova_compute
- nova_ceph_client in ceph_client_filtered_clients | map(attribute='name') | list

View File

@@ -15,7 +15,7 @@
# look for 1 ceph monitor host that is up
- name: Verify Ceph monitors are up
wait_for_connection:
ansible.builtin.wait_for_connection:
connect_timeout: 3
timeout: 10
delegate_to: "{{ item }}"
@@ -25,7 +25,7 @@
register: ceph_mon_upcheck
- name: Set ceph_mon_host to an online monitor host
set_fact:
ansible.builtin.set_fact:
ceph_mon_host: "{{ item.item }}"
when:
- item is success
@@ -34,7 +34,7 @@
with_items: "{{ ceph_mon_upcheck.results }}"
- name: Fail when no ceph_mon_host is reachable
fail:
ansible.builtin.fail:
msg: "No Ceph Monitor reachable"
when:
- ceph_mon_host is undefined

View File

@@ -14,20 +14,20 @@
# limitations under the License.
- name: Set permissions on immutable object cache directory
file:
ansible.builtin.file:
path: "{{ ceph_immutable_object_cache_dir }}"
owner: "{{ ceph_immutable_object_cache_owner }}"
group: "{{ ceph_immutable_object_cache_group }}"
mode: "{{ ceph_immutable_object_cache_mode }}"
- name: Add libvirt-qemu user to ceph group
user:
ansible.builtin.user:
append: true
name: "{{ ceph_immutable_object_cache_group }}"
groups: "ceph"
- name: Create ceph immutable object cache service overrides
import_role:
ansible.builtin.import_role:
name: systemd_service
vars:
systemd_services:
@@ -49,7 +49,7 @@
}}
- name: Ensure ceph immutable object cache service is running
service:
ansible.builtin.service:
name: "{{ ceph_immutable_object_cache_service_name }}1.service"
state: started
enabled: true

View File

@@ -14,7 +14,7 @@
# limitations under the License.
- name: Install ceph packages
package:
ansible.builtin.package:
name: "{{ ceph_client_filtered_packages }}"
state: "{{ ceph_client_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"

View File

@@ -14,7 +14,7 @@
# limitations under the License.
- name: Find the venv's python version
find:
ansible.builtin.find:
paths: "{{ openstack_service_venv_bin | dirname }}/lib/"
patterns: "python*"
file_type: directory
@@ -22,40 +22,40 @@
register: python_venv_details
- name: Set python venvs details
set_fact:
ansible.builtin.set_fact:
venv_python_lib_folder: "{{ python_venv_details.files[0].path }}"
ceph_python_interp: "/usr/bin/python3"
- name: Register rados module path
command: "{{ ceph_python_interp }} -c 'import rados; print(rados.__file__)'"
ansible.builtin.command: "{{ ceph_python_interp }} -c 'import rados; print(rados.__file__)'"
changed_when: false
register: rados_module_path
- name: Register rbd module path
command: "{{ ceph_python_interp }} -c 'import rbd; print(rbd.__file__)'"
ansible.builtin.command: "{{ ceph_python_interp }} -c 'import rbd; print(rbd.__file__)'"
changed_when: false
register: rbd_module_path
- name: Register cephfs module path
command: "{{ ceph_python_interp }} -c 'import cephfs; print(cephfs.__file__)'"
ansible.builtin.command: "{{ ceph_python_interp }} -c 'import cephfs; print(cephfs.__file__)'"
changed_when: false
failed_when: false
register: cephfs_module_path
- name: Register ceph_volume_client path
command: "{{ ceph_python_interp }} -c 'import ceph_volume_client; print(ceph_volume_client.__file__)'"
ansible.builtin.command: "{{ ceph_python_interp }} -c 'import ceph_volume_client; print(ceph_volume_client.__file__)'"
changed_when: false
failed_when: false
register: ceph_volume_client_module_path
- name: Register ceph_argparse path
command: "{{ ceph_python_interp }} -c 'import ceph_argparse; print(ceph_argparse.__file__)'"
ansible.builtin.command: "{{ ceph_python_interp }} -c 'import ceph_argparse; print(ceph_argparse.__file__)'"
changed_when: false
failed_when: false
register: ceph_argparse_module_path
- name: Link rados module into the venv
file:
ansible.builtin.file:
src: "{{ rados_module_path.stdout | replace('.pyc', '.py') }}"
dest: "{{ venv_python_lib_folder }}/site-packages/{{ rados_module_path.stdout | basename | replace('.pyc', '.py') }}"
state: link
@@ -64,7 +64,7 @@
- Restart os services
- name: Link rbd module into the venv
file:
ansible.builtin.file:
src: "{{ rbd_module_path.stdout | replace('.pyc', '.py') }}"
dest: "{{ venv_python_lib_folder }}/site-packages/{{ rbd_module_path.stdout | basename | replace('.pyc', '.py') }}"
state: link
@@ -73,7 +73,7 @@
- Restart os services
- name: Link cephfs module into the venv
file:
ansible.builtin.file:
src: "{{ cephfs_module_path.stdout | replace('.pyc', '.py') }}"
dest: "{{ venv_python_lib_folder }}//site-packages/{{ cephfs_module_path.stdout | basename | replace('.pyc', '.py') }}"
state: link
@@ -84,7 +84,7 @@
- Restart os services
- name: Link ceph_volume_client module into the venv
file:
ansible.builtin.file:
src: "{{ ceph_volume_client_module_path.stdout | replace('.pyc', '.py') }}"
dest: "{{ venv_python_lib_folder }}/site-packages/{{ ceph_volume_client_module_path.stdout | basename | replace('.pyc', '.py') }}"
state: link
@@ -95,7 +95,7 @@
- Restart os services
- name: Link ceph_argparse module into the venv
file:
ansible.builtin.file:
src: "{{ ceph_argparse_module_path.stdout | replace('.pyc', '.py') }}"
dest: "{{ venv_python_lib_folder }}/site-packages/{{ ceph_argparse_module_path.stdout | basename | replace('.pyc', '.py') }}"
state: link

View File

@@ -24,20 +24,20 @@
# NOTE(jrosser) remove this task for the 2025.2 release
- name: Find legacy repository files
find:
ansible.builtin.find:
paths: /etc/apt/sources.list.d/
patterns: "{{ ceph_repo_url | urlsplit('hostname') | replace('.', '_') }}_*.list"
register: _legacy_apt_repos
- name: Clean up legacy repository config not in deb822 format
file:
ansible.builtin.file:
path: "{{ item['path'] }}"
state: absent
with_items: "{{ _legacy_apt_repos['files'] }}"
register: apt_repo_removed
- name: Ensure python3-debian package is available
apt:
ansible.builtin.apt:
name: python3-debian
- name: Manage apt repositories
@@ -76,7 +76,7 @@
register: deb822_repos
- name: Update Apt cache
apt:
ansible.builtin.apt:
update_cache: true
when: (apt_repo_removed is changed) or (deb822_repos is changed)
register: update_apt_cache

View File

@@ -14,7 +14,7 @@
# limitations under the License.
- name: Download EPEL gpg keys
get_url:
ansible.builtin.get_url:
url: "{{ item.url }}"
dest: "{{ item.key }}"
mode: "0640"
@@ -27,7 +27,7 @@
- ceph_pkg_source == 'ceph'
- name: Copy Ceph gpg keyfile to the key location
copy:
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.key }}"
mode: "0640"
@@ -36,7 +36,7 @@
- ceph_pkg_source == 'ceph'
- name: Install Ceph gpg keys
rpm_key:
ansible.builtin.rpm_key:
key: "{{ key['key'] }}"
fingerprint: "{{ key['fingerprint'] | default(omit) }}"
state: "{{ key['state'] | default('present') }}"
@@ -49,7 +49,7 @@
delay: 2
- name: Install required repositories
yum_repository:
ansible.builtin.yum_repository:
baseurl: "{{ item.baseurl }}"
description: "{{ item.description | default(omit) }}"
enabled: "{{ item.enabled | default(True) }}"

View File

@@ -14,14 +14,14 @@
# limitations under the License.
- name: End playbook if disabled
meta: end_play
ansible.builtin.meta: end_play
when:
- ceph_mons | list | length == 0 and ceph_conf_file is not defined
tags:
- always
- name: Gather variables for each operating system
include_vars: "{{ lookup('first_found', params) }}"
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
@@ -36,13 +36,13 @@
- always
- name: Fail if ceph_pkg_source uses an incorrect parameter
fail:
ansible.builtin.fail:
msg: "Invalid value for ceph_pkg_source. Valid parameters are ceph, distro."
when:
- ceph_pkg_source not in ['ceph', 'distro']
- name: Including ceph_preinstall tasks
include_tasks: "ceph_preinstall_{{ ansible_facts['pkg_mgr'] }}.yml"
ansible.builtin.include_tasks: "ceph_preinstall_{{ ansible_facts['pkg_mgr'] }}.yml"
args:
apply:
tags:
@@ -51,7 +51,7 @@
- ceph-install
- name: Including ceph_install tasks
include_tasks: ceph_install.yml
ansible.builtin.include_tasks: ceph_install.yml
args:
apply:
tags:
@@ -60,7 +60,7 @@
- ceph-install
- name: Including ceph_install_python_libs tasks
include_tasks: ceph_install_python_libs.yml
ansible.builtin.include_tasks: ceph_install_python_libs.yml
when:
- openstack_service_venv_bin | length > 0
args:
@@ -71,7 +71,7 @@
- ceph-install
- name: Including ceph_get_mon_host tasks
include_tasks: ceph_get_mon_host.yml
ansible.builtin.include_tasks: ceph_get_mon_host.yml
when: ceph_conf_file is not defined or ceph_keyrings_dir is not defined
args:
apply:
@@ -81,7 +81,7 @@
- ceph-config
- name: Including ceph_config tasks
include_tasks: ceph_config.yml
ansible.builtin.include_tasks: ceph_config.yml
args:
apply:
tags:
@@ -90,7 +90,7 @@
- ceph-config
- name: Including ceph_auth tasks
include_tasks: ceph_auth.yml
ansible.builtin.include_tasks: ceph_auth.yml
when:
- cephx | bool
args:
@@ -101,7 +101,7 @@
- ceph-config
- name: Including ceph_immutable_object_cache tasks
include_tasks: ceph_immutable_object_cache.yml
ansible.builtin.include_tasks: ceph_immutable_object_cache.yml
when:
- ceph_immutable_object_cache_enabled | bool
args:
@@ -128,7 +128,7 @@
- ceph-config
- name: Set permissions on persistent write log cache directory
file:
ansible.builtin.file:
path: "{{ ceph_persistent_write_log_cache_dir }}"
owner: "{{ ceph_persistent_write_log_cache_owner }}"
group: "{{ ceph_persistent_write_log_cache_group }}"