【发布时间】:2018-01-18 00:42:48
【问题描述】:
我目前在通过 SSH Bastion 主机运行 Ansible F5 playbook 以配置 F5 设备时遇到问题,目前不确定问题出在哪里。
BIGSUDS、SUDS、F5-SDK 全部通过 pip 安装
我的剧本 --- f5play.yml ----
---
- hosts: f5_devices
gather_facts: false
connection: local
tasks:
- name: f5 test
bigip_facts:
server: "{{ inventory_hostname }}"
user: "{{ ansible_user }}"
password: "{{ ansible_ssh_pass }}"
include: "interface"
validate_certs: false
delegate_to: localhost
register: out
- debug: msg= "{{ out }}"
我有一个“group_vars”目录和一个“f5_devices”目录,其中包含我的 vault.yml 和 vars.yml
vars.yml 包含我的额外代理信息,用于在跳转到 f5 之前跳过中间 ssh 主机,之前已成功用于此设置以到达 Cisco 设备。
库存文件 = ansible_hosts
[f5_devices]
F5-LTM1 ansible_user=admin
--vars.yml--
ansible_ssh_pass: "{{ vault_ansible_ssh_pass }}"
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -v bastion1" -o
StrictHostKeyChecking=no'
ansible-playbook -i ansible_hosts f5play.yml --ask-vault-pass -vvv
更新 - 添加了“delegate_to: localhost” 现在,还是这个错误
"session": false,
"state": "present",
"user": "admin",
"validate_certs": false
}
},
"msg": "received exception: <urlopen error [Errno -2] Name or service
not known>\ntraceback: Traceback (most recent call last):\n File
\"/tmp/ansible_cdaERk/ansible_module_bigip_facts.py\", line 1664, in main\n
saved_active_folder = f5.get_active_folder()\n File
\"/tmp/ansible_cdaERk/ansible_module_bigip_facts.py\", line 148, in
get_active_folder\n return self.api.System.Session.get_active_folder()\n
File \"/home/mike/Proj/ansible/lib/python2.7/site-packages/bigsuds.py\",
line 360, in __getattr__\n client = self._client_creator('%s.%s' %
(self._name, attr))\n File \"/home/mike/Proj/ansible/lib/python2.7/site-
packages/bigsuds.py\", line 170, in _create_client\n raise
ConnectionError(str(e))\nConnectionError: <urlopen error [Errno -2] Name or
service not known>\n"
}
忘了补充,这是在虚拟环境中运行的(virtualenv ansible)
任何帮助都会“非常”感激
【问题讨论】:
标签: python ansible ssh-tunnel f5