需要一些幫助,也許它只是我必須降級我的安裝。在2.1版本中運行的一本非常有用的劇本現在出現了「NameError:global name'get_module'未定義的錯誤」。升級有我想用於網絡的模塊。MacOS + Ansible從2.1升級到2.3 - NameError:未定義全局名稱'get_module'
PLAY [ios] ****************************************************************************************************************************************************************************************************************************************
TASK [OBTAIN LOGIN CREDS] *************************************************************************************************************************************************************************************************************************
ok: [172.26.26.10]
TASK [DEFINE PROVIDER] ****************************************************************************************************************************************************************************************************************************
ok: [172.26.26.10]
TASK [LOAD NEW ACL INTO DEVICE] *******************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name 'get_module' is not defined
fatal: [172.26.26.10]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File \"/var/folders/yw/l2nj7vf50dqg2hrjw8qnp9b9vkc_p4/T/ansible_4xFueF/ansible_module_ios_config.py\", line 224, in <module>\n main()\n File \"/var/folders/yw/l2nj7vf50dqg2hrjw8qnp9b9vkc_p4/T/ansible_4xFueF/ansible_module_ios_config.py\", line 177, in main\n module = get_module(argument_spec=argument_spec,\nNameError: global name 'get_module' is not defined\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/Users/prahbor/Documents/Scripts/ansible/parents_playbook.retry
PLAY RECAP ****************************************************************************************************************************************************************************************************************************************
172.26.26.10 : ok=2 changed=0 unreachable=0 failed=1
PLAYBOOK IS
---
- hosts: ios
gather_facts: no
connection: local
tasks:
- name: OBTAIN LOGIN CREDS
include_vars: ~/Documents/Scripts/ansible/group_vars/all.yml
- name: DEFINE PROVIDER
set_fact:
provider:
host: "{{inventory_hostname}}"
username: "{{ ansible_user }}"
password: "{{ ansible_ssh_pass }}"
- name: LOAD NEW ACL INTO DEVICE
ios_config:
provider: "{{ provider }}"
parents: ip access-list extended ansible_test
lines:
- permit tcp host 10.1.1.1 any log
- permit tcp host 10.1.1.2 any log
- permit tcp host 10.1.1.3 any log
- permit tcp host 10.1.1.4 any log
- permit tcp host 1.1.1.1 any log
- permit tcp host 2.2.2.2 any log
before: no ip access-list extended ansible_test
match: exact
replace: line
notify: save