Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ansible 无论传入什么标记,如何执行预任务?_Ansible - Fatal编程技术网

Ansible 无论传入什么标记,如何执行预任务?

Ansible 无论传入什么标记,如何执行预任务?,ansible,Ansible,我希望执行include_vars任务,而不管传入了什么标记。现在,传入的任何标记都会过滤掉我的include\u varspre任务 您可以始终使用-始终-强制任务始终运行,而不考虑指定的标记。这正是我需要的。非常感谢。 --- - name: superduper playbook hosts: aws-region1 remote_user: mesrine pre_tasks: - include_vars: "{{ env }}/group_vars/vanco

我希望执行
include_vars
任务,而不管传入了什么标记。现在,传入的任何标记都会过滤掉我的
include\u vars
pre任务

您可以始终使用-
始终
-强制任务始终运行,而不考虑指定的标记。

这正是我需要的。非常感谢。
---    
- name: superduper playbook
  hosts: aws-region1
  remote_user: mesrine
  pre_tasks:
  - include_vars: "{{ env }}/group_vars/vancouver"
    when: region is defined and region == 'van'
  ...snipped...