]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
lint: do not use 'local_action'
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 2 Oct 2020 11:43:47 +0000 (13:43 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Dec 2020 13:05:45 +0000 (14:05 +0100)
Fix ansible-lint 504 error:

[504] Do not use 'local_action', use 'delegate_to: localhost'

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit c948b668ebe7cf7af61090ac6f9b93e0a16e14ee)

infrastructure-playbooks/gather-ceph-logs.yml
infrastructure-playbooks/purge-cluster.yml

index dbfb1688afdeb64a16246c5fb7820fb7fd2ee63e..7d1b84072fb02540e7463122ccaef50a2cabfce5 100644 (file)
 
   tasks:
     - name: create a temp directory
-      local_action:
-        module: tempfile
+      tempfile:
         state: directory
         prefix: ceph_ansible
       run_once: true
       register: localtempfile
       become: false
+      delegate_to: localhost
 
     - name: set_fact lookup_ceph_config - lookup keys, conf and logs
       find:
index f77bab4755dd9d32e26e8582f96b035608b656f6..d8c625bec3f422cca7fc4b2f789dc23bbd288462 100644 (file)
 
   - name: wait for server to boot
     become: false
-    local_action:
-      module: wait_for
+    wait_for:
       port: 22
       host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
       state: started
       delay: 10
       timeout: 500
+      delegate_to: localhost
 
   - name: remove data
     shell: rm -rf /var/lib/ceph/*
     ignore_errors: true
 
   - name: is reboot needed
-    local_action:
-      module: command
-        echo requesting reboot
+    command: echo requesting reboot
+    delegate_to: localhost
     become: false
     notify:
       - restart machine
      state: absent
 
   - name: request data removal
-    local_action:
-      module: command
-        echo requesting data removal  # noqa 301
+    command: echo requesting data removal  # noqa 301
     become: false
+    delegate_to: localhost
     notify: remove data
 
   - name: purge dnf cache