我正在写一本剧本来测试使用ansible的Cisco Nexus交换机升级。我正在使用“ nxos_install_os”模块来定义任务。当我执行时,我看到一条错误消息
PERSISTENT_COMMAND_TIMEOUT和PERSISTENT_CONNECT_TIMEOUT必须设置为600秒。
我确实将ansible.cfg文件中的command_timeout和connection_timeout更改为1800秒,并且我更改了连接:network_cli的本地连接,以便我也可以在剧本中定义这些超时值。下面是我拥有的剧本,我仍然看到相同的错误。有什么我想念的吗?
- hosts: Switch
connection: network_cli
vars:
ANSIBLE_PERSISTENT_COMMAND_TIMEOUT: 1800
ANSIBLE_PERSISTENT_CONNECT_TIMEOUT: 1800
ansible_network_os: nxos
tasks:
- name: Install OS on N9k
check_mode: yes
nxos_install_os:
system_image_file: system_bin
kickstart_image_file: kickstart.bin
issu: desired
ignore_errors: yes
register: output
“ PERSISTENT_COMMAND_TIMEOUT和PERSISTENT_CONNECT_TIMEOUT必须设置为600秒”
答案 0 :(得分:0)
我很遗憾,错误消息是如此不透明,但是从this thread看来,实际的list_df <- lapply(gsub("([[:punct:]])", " \\1 ",
df$text), function(x) scan(text = x, what = "", quiet = TRUE))
sapply(list_df, '[', 1:max(lengths(list_df)))
# [,1] [,2] [,3]
# [1,] "How" "Why" "How"
# [2,] "did" "does" "do"
# [3,] "Quebec" "valve" "I"
# [4,] "?" "=" "use"
# [5,] "1" "." "a"
# [6,] "2" "245" "period"
# [7,] "3" NA "("
# [8,] NA NA "."
# [9,] NA NA ")"
#[10,] NA NA "comma"
#[11,] NA NA "["
#......
名称是vars:
,但遗憾的是看起来好像没有用于连接的var暂停。您必须在ansible_command_timeout
中指定它。
但是,基于:
我确实在ansible.cfg中更改了command_timeout和connection_timeout
我猜测您可能没有将它们放在正确的部分中,或者您正在从包含ansible.cfg
的目录之外的目录中运行ansible
根据文档,我希望ansible.cfg
包含:
ansible.cfg