1

我正在寻找从文件加载额外变量的 Ansible Tower 等效方法。就像从带有 ...--extra-vars "@somefile.yml" 参数的 cli 中一样。这可以在 Ansible Tower 中完成吗?

4

1 回答 1

0

From the Tower you have several options:

  1. Under Job Templates use the Extra Variables option. This is the --extra-vars equivalent to the cli (Take into account that Tower is not cli and you cannot pass a file but you can copy/paste your file there)
  2. Use Surveys
  3. Load the Var file from your playbook directly and make it "flexible" with a variable to be sent from a Survey like:

- name: Load a variable file based on Survey, or a default if not found.
  include_vars: "{{ item }}"
  with_first_found:
    - "{{ firts_option }}.yaml"
    - "{{ second_option }}.yaml"
    - default.yaml 
于 2018-05-05T06:56:00.113 回答