From b0db0e610ea0a641a9553c0bacacfca0c7c3d735 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Mon, 4 Jan 2021 02:30:31 +0100 Subject: [PATCH] use inventory_dir for host_vars directory --- tasks/save.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tasks/save.yml b/tasks/save.yml index 353dcaa..f84bd5e 100644 --- a/tasks/save.yml +++ b/tasks/save.yml @@ -1,7 +1,13 @@ --- - name: host_vars directory - local_action: file path=host_vars/{{inventory_hostname}} state=directory + local_action: file + args: + path: "{{inventory_dir}}/host_vars/{{inventory_hostname}}" + state: directory - name: host_vars file - local_action: template src=host_vars.j2 dest=host_vars/{{inventory_hostname}}/ssh_host_key.yml + local_action: template + args: + src: host_vars.j2 + dest: "{{inventory_dir}}/host_vars/{{inventory_hostname}}/ssh_host_key.yaml"