English 中文(简体)
核实额外可变值是否正确列入可发挥作用书
原标题:validate whether the extra variable value is correct in ansible-playbook
  • 时间:2024-01-07 01:56:52
  •  标签:
  • ansible

我有一套可操作的游戏手册,要求——必须经过——并且想知道,是否有任何办法证实价值是清单变量之一。

抽样检测。

- hosts: localhost
  gather_facts: false
  vars:
    prod_mgmt_network: "{{ [ server00 ]|product(range(start,end))|map( join )|list }}"
    start: 4281
    end: 4283
  tasks:
    - debug:
        var: prod_mgmt_network

样本

ansible-playbook --extra-vars hostName=server004181 test.yml

如果--------------------------------

问题回答




相关问题
Related Docker networks for apps in separate Ansible roles

Suppose I m using a webserver / reverse proxy (traefik, nginx, apache, etc.) for various apps. If the webserver and all the apps are in the same docker-compose.yml then it s easy to configure the ...

Lookup method interpreting result

I am using a lookup method which returns a password (using cyberark.. but that is not relevant for this issue description) When the password happens to contain a curly brace and there is a variable in ...

利用胶卷更新多个组的库存档案

我正在尝试在多个位置更新特定剧本的库存文件。这是被简化的剧本。请注意,实际环境中已删除引用的配置。

How to fallback to a default value when ansible lookup fails?

I was a little bit surprised to discover that his piece of code fails with an IOError exception instead of defaulting to omitting the value. #!/usr/bin/env ansible-playbook -i localhost, --- - hosts: ...