小编J08*_*car的帖子

在 ansible 中,我可以为模块使用变量而不是使用模块名称吗?

我正在使用 ansible 2.9,我想知道是否可以使用变量而不是实际的模块名称。例如:

---
- name: A Network play
  hosts: routers
  vars:
    router_module: ios_command
  tasks:
    - name: a network task
      {{router_module}}:
        commands:
          - show ip int brief 
Run Code Online (Sandbox Code Playgroud)

ansible

3
推荐指数
1
解决办法
283
查看次数

标签 统计

ansible ×1