From f33cc920bd9c958106d0baca7b4892947cac0fb2 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 5 Jul 2022 11:58:30 +0200 Subject: Do not execute any remote action on localhost --- distrib.yml | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/distrib.yml b/distrib.yml index d5eb816..8c30982 100644 --- a/distrib.yml +++ b/distrib.yml @@ -73,30 +73,31 @@ vars: ansible_python_interpreter: "auto_silent" tasks: - - name: "Copy dotfiles.tar.xz to remote" - copy: - src: "~/dotfiles.tar.xz" - dest: "~/dotfiles.tar.xz" - mode: "0640" - tags: - - "remote" - - "all" - - name: "Unpack dotfiles.tar.xz" - unarchive: - dest: "~/" - src: "~/dotfiles.tar.xz" - remote_src: "yes" - list_files: "yes" - tags: - - "unpack" - - "all" - - name: "Remove tarball on remote" - file: - path: "~/dotfiles.tar.xz" - state: "absent" - tags: - - "removal" - - "all" + - block: + - name: "Copy dotfiles.tar.xz to remote" + copy: + src: "~/dotfiles.tar.xz" + dest: "~/dotfiles.tar.xz" + mode: "0640" + tags: + - "remote" + - "all" + - name: "Unpack dotfiles.tar.xz" + unarchive: + dest: "~/" + src: "~/dotfiles.tar.xz" + remote_src: "yes" + list_files: "yes" + tags: + - "unpack" + - "all" + - name: "Remove tarball on remote" + file: + path: "~/dotfiles.tar.xz" + state: "absent" + tags: + - "removal" + - "all" when: inventory_hostname != hostvars['localhost']['ansible_fqdn'] and inventory_hostname != hostvars['localhost']['ansible_hostname'] and inventory_hostname != hostvars['localhost']['ansible_hostname'] | lower -- cgit v1.2.3