浏览代码

use inventory_dir for host_vars directory

master
父节点
当前提交
b0db0e610e
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. +8
    -2
      tasks/save.yml

+ 8
- 2
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"

正在加载...
取消
保存