这是我的游戏机。我正在尝试向我的交换机添加一个新的日志服务器。
---
- name: "Add new logging server"
hosts: all
gather_facts: no
tasks:
- name: Add logging server
cisco.ios.ios_logging_global:
config:
hosts:
- hostname: 10.255.0.2
logging_on: enable
trap: informational实战手册正在工作(它确实添加了服务器),但它不是幂等的。还有其他人有这个问题吗?我已经检查了LF和编码。银河集合"cisco.ios“的版本是2.5。
我的ansible版本是:
$ansible --版本
ansible 2.10.9
config file = /home/fredr/ansible/ansible.cfg
configured module search path = ['/home/fredr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/fredr/.local/lib/python3.8/site-packages/ansible
executable location = /home/fredr/.local/bin/ansible
python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]怎样才能使它成为幂等的呢?
发布于 2021-09-28 03:22:34
如果我这样做,它就会变成幂等。
- name: Add logging server
cisco.ios.ios_logging_global:
config:
hosts:
- hostname: 10.255.0.2原因是它使用运行配置,因为它的默认值是"logging enable“和"logging informational",所以它们不会显示在运行配置中。
需要在配置中显示您要设置的行。
https://stackoverflow.com/questions/69355426
复制相似问题