From 3f632b29004c793c6ee8d4fa2aed3504c21f276f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 13 Feb 2025 08:00:23 +0100 Subject: [PATCH] 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: Ib419694a702f1fe680f360aa8c50f9abc4691fec --- handlers/main.yml | 2 +- tasks/main.yml | 8 ++++---- tasks/memcached_config.yml | 12 ++++++------ tasks/memcached_install.yml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 001808b..3dd9d62 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -14,7 +14,7 @@ # limitations under the License. - name: Restart memcached - systemd: + ansible.builtin.systemd: name: "memcached" state: "restarted" enabled: true diff --git a/tasks/main.yml b/tasks/main.yml index e87d2b1..10b1f02 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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,14 +29,14 @@ - always - name: Importing memcached_install tasks - import_tasks: memcached_install.yml + ansible.builtin.import_tasks: memcached_install.yml tags: - memcached_server-install - name: Importing memcached_config tasks - import_tasks: memcached_config.yml + ansible.builtin.import_tasks: memcached_config.yml tags: - memcached_server-config - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/tasks/memcached_config.yml b/tasks/memcached_config.yml index 7701d2a..3b87649 100644 --- a/tasks/memcached_config.yml +++ b/tasks/memcached_config.yml @@ -14,7 +14,7 @@ # limitations under the License. - name: Apply memcached config - template: + ansible.builtin.template: src: "{{ memcached_conf_template }}" dest: "{{ memcached_conf_dest }}" owner: "root" @@ -23,7 +23,7 @@ notify: Restart memcached - name: Override systemd service file - copy: + ansible.builtin.copy: src: "{{ memcached_systemd_service }}" dest: "/etc/systemd/system/memcached.service" owner: "root" @@ -33,7 +33,7 @@ notify: Restart memcached - name: Create memcached systemd service config dir - file: + ansible.builtin.file: path: "/etc/systemd/system/memcached.service.d" state: "directory" group: "root" @@ -41,7 +41,7 @@ mode: "0755" - name: Apply systemd options - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "/etc/systemd/system/memcached.service.d/{{ item.dest }}" mode: "0644" @@ -54,7 +54,7 @@ - Restart memcached - name: Configure soft file limits - lineinfile: + ansible.builtin.lineinfile: dest: "/etc/security/limits.conf" regexp: "^{{ memcached_user }}.*soft.*nofile.*" state: "present" @@ -62,7 +62,7 @@ insertbefore: "^# End of file" - name: Configure hard file limits - lineinfile: + ansible.builtin.lineinfile: dest: "/etc/security/limits.conf" regexp: "^{{ memcached_user }}.*hard.*nofile.*" state: "present" diff --git a/tasks/memcached_install.yml b/tasks/memcached_install.yml index afc1003..4ec9957 100644 --- a/tasks/memcached_install.yml +++ b/tasks/memcached_install.yml @@ -14,7 +14,7 @@ # limitations under the License. - name: Install distro packages - package: + ansible.builtin.package: name: "{{ memcached_distro_packages }}" state: "{{ memcached_package_state }}" update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"