一个会话无法建立Ansible Paramiko SSH

问题描述

我有基于freebsd的sandvine设备,我需要创建用于多自动化目的的剧本,但是当我需要升级特权时遇到了问题,唯一的升级特权的方法是通过此命令sv_enable sv_admin,它的工作原理类似于su -命令将提示符从>$更改为># sudo在这里不起作用,因此当我运行剧本时,当涉及到此命令sv_enable sv_admin时,剧本挂起了,我将Ansible的默认ssh连接更改为paramkio,但是仍然没有遇到同样的问题,我感谢您及时注意此问题,并在此先感谢您。

我的剧本:

---
- hosts: device-01
  gather_facts: false
  remote_user: sv_admin
  connection: paramiko
  vars:
    ansible_ssh_private_key_file: /root/.ssh/m2q_id_rsa
    #ansible_ssh_pass: /root/.ssh/m2q_passphrase
  tasks:
    - name: Check Paramiko privilege escalation
      command: "{{ item }}"
      with_items:
        - id
        - pwd
        - 'sv_enable sv_admin'
        - id
      register: shell_output
    - debug: var=shell_output
    - debug:
        msg: hello

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...