--- - name: host_vars directory local_action: file path=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