I have some plabyooks that are working, but when im trying to start using jinja2 i'm getting some failures. Attached are my files.
tree
.
├── host_vars
│ └── s-2930f-2.yml
├── inventory.yml
├── playbook.yml
└── templates
└── vlan.j2
PLAY [all] ***********************************************************************************************************************************************************************************
TASK [Global config: Create VLAN] ************************************************************************************************************************************************************
[WARNING]: Platform linux on host s-2930f-2 is using the discovered Python interpreter at /usr/bin/python3.6, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
fatal: [s-2930f-2]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3.6"}, "changed": false, "command": "{% for vlan in vlans %}", "msg": "[24;56H %}Invalid input: {%\r
Aruba-2930F-8G-PoEP-2SFPP(config)# ", "rc": -32603}
PLAY RECAP ***********************************************************************************************************************************************************************************
s-2930f-2 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
[root@ansible1 vlanVarsv02]# ansible-playbook playbook.yml -i inventory.yml -vvv
ansible-playbook 2.9.7
config file = /root/ansible/vlanVarsv02/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/.local/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Nov 10 2019, 15:33:49) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4.0.1)]
Using /root/ansible/vlanVarsv02/ansible.cfg as config file
host_list declined parsing /root/ansible/vlanVarsv02/inventory.yml as it did not pass its verify_file() method
script declined parsing /root/ansible/vlanVarsv02/inventory.yml as it did not pass its verify_file() method
Parsed /root/ansible/vlanVarsv02/inventory.yml inventory source with yaml plugin
PLAYBOOK: playbook.yml ***********************************************************************************************************************************************************************
1 plays in playbook.yml
PLAY [all] ***********************************************************************************************************************************************************************************
META: ran handlers
TASK [Global config: Create VLAN] ************************************************************************************************************************************************************
task path: /root/ansible/vlanVarsv02/playbook.yml:4
<172.19.43.7> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.19.43.7> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-5362cko_5me1 `"&& mkdir /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761 && echo ansible-tmp-1588007743.3714168-5369-88970546045761="` echo /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761 `" ) && sleep 0'
<s-2930f-2> Attempting python interpreter discovery
<172.19.43.7> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<172.19.43.7> EXEC /bin/sh -c '/usr/bin/python3.6 && sleep 0'
<s-2930f-2> Python interpreter discovery fallback (unsupported Linux distribution: oracle)
Using module file /root/.local/lib/python3.6/site-packages/ansible/modules/network/arubaoss/arubaoss_config.py
<172.19.43.7> PUT /root/.ansible/tmp/ansible-local-5362cko_5me1/tmpj5nqx9pu TO /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761/AnsiballZ_arubaoss_config.py
<172.19.43.7> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761/ /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761/AnsiballZ_arubaoss_config.py && sleep 0'
<172.19.43.7> EXEC /bin/sh -c '/usr/bin/python3.6 /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761/AnsiballZ_arubaoss_config.py && sleep 0'
<172.19.43.7> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-5362cko_5me1/ansible-tmp-1588007743.3714168-5369-88970546045761/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Platform linux on host s-2930f-2 is using the discovered Python interpreter at /usr/bin/python3.6, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
fatal: [s-2930f-2]: FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3.6"
},
"changed": false,
"command": "{% for vlan in vlans %}",
"invocation": {
"module_args": {
"after": null,
"api_version": "None",
"backup": false,
"backup_options": null,
"before": null,
"diff_against": null,
"diff_ignore_lines": null,
"host": null,
"intended_config": null,
"lines": null,
"match": "line",
"parents": null,
"password": null,
"port": null,
"provider": null,
"replace": "line",
"running_config": null,
"save_when": "never",
"src": "templates/vlan.j2",
"ssh_keyfile": null,
"timeout": null,
"use_ssl": null,
"username": null,
"validate_certs": false
}
},
"msg": "[24;56H %}Invalid input: {%\r
Aruba-2930F-8G-PoEP-2SFPP(config)# ",
"rc": -32603
}
PLAY RECAP ***********************************************************************************************************************************************************************************
s-2930f-2 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
error output is here: