automation - 提升到特权级别
问题描述
当我在 GNS3 上的 Ansible 上运行它时,我收到了这个错误。谁能帮我解决这个错误?
主机文件
[ios]
172.20.10.55
[ios:vars]
ansible_network_os=ios
ansible_user=admin
ansible_password=cisco
ansible_become=yes
ansible_become_method=enable
剧本
- name: multiple commands
hosts: ios
gather_facts: false
connection: network_cli
tasks:
- name: configure ospf
ios_config:
lines:
- configure terminal
- 10 pemrit ip host 192.168.1.1 any log
parents: ip access-list extended test
错误
TASK [configure ospf] **********************************************************
fatal: [172.20.10.55]: FAILED! => {"changed": false, "msg": "unable to elevate privilege to enable mode, at prompt [\nR1>] with error: failed to elevate privilege to enable mode still at prompt [\nR1>]"}
PLAY RECAP *********************************************************************
172.20.10.55 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
解决方案
你需要设置ansible_become_password
.
https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
推荐阅读
- html - 我想改变visualViewport的比例。我怎样才能务实地实现这一目标?
- android - 错误在构建 ionic android 应用程序时无法读取 null 的属性“1”
- php - Dockerized Laravel 应用程序,资产总是 404
- .net - MsBuild 目标不起作用
- regex - 如何返回变量并在 Python 类中的其他函数/方法中重用它们
- c++ - LibXL:excel 跨表公式未更新
- c# - 单击按钮时增加的 ASP.NET 变量
- php - 从php中的csv文件中删除每行开头的字符
- java - 当 Spring Boot 健康检查状态发生变化时得到通知
- javascript - 如何自定义完整日历中的时间段?