# Erreur\_ansible\_nokia

**URL:** <https://forum.ansible.com/t/erreur-ansible-nokia/37867>\
**Category:** Ansible Project\
**Tags:** srlinux\
**Created:** [April 9, 2023, 1:26pm UTC](https://forum.ansible.com/t/erreur-ansible-nokia/37867 "2023-04-09T13:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youssef\_Elahmadi](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Youssef\_Elahmadi](https://forum.ansible.com/u/Youssef_Elahmadi)\
**Post date:** [April 9, 2023, 1:26pm UTC](https://forum.ansible.com/t/erreur-ansible-nokia/37867/1 "2023-04-09T13:26:46Z")

</div>

Dear [Group Members],

I hope this email finds you well. I am reaching out to ask for your assistance with an issue I am facing in my project involving Ansible for a Nokia equipment.

I have encountered some difficulties in configuring the equipment using Ansible and I am in need of some guidance and support

I would greatly appreciate it if any of you who have experience working with this technology could lend me a hand

this is the output :

The full traceback is:  
Traceback (most recent call last):  
File “/home/srv\_22/.ansible/collections/ansible\_collections/ansible/netcommon/plugins/plugin\_utils/connection\_base.py”, line 42, in **getattr**  
return self. **dict** [name]  
KeyError: ‘\_nonetype’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/home/srv\_22/.local/lib/python3.10/site-packages/ansible/executor/task\_executor.py”, line 1005, in \_set\_plugin\_options  
plugin = getattr(self._connection, '_%s’ % plugin\_type)  
File “/home/srv\_22/.ansible/collections/ansible\_collections/ansible/netcommon/plugins/plugin\_utils/connection\_base.py”, line 50, in **getattr**  
raise AttributeError(  
AttributeError: ‘Connection’ object has no attribute ‘\_nonetype’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/home/srv\_22/.ansible/collections/ansible\_collections/ansible/netcommon/plugins/plugin\_utils/connection\_base.py”, line 42, in **getattr**  
return self. **dict** [name]  
KeyError: ‘nonetype’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/home/srv\_22/.local/lib/python3.10/site-packages/ansible/executor/task\_executor.py”, line 158, in run  
res = self.\_execute()  
File “/home/srv\_22/.local/lib/python3.10/site-packages/ansible/executor/task\_executor.py”, line 560, in \_execute  
plugin\_vars = self.\_set\_connection\_options(cvars, templar)  
File “/home/srv\_22/.local/lib/python3.10/site-packages/ansible/executor/task\_executor.py”, line 1087, in \_set\_connection\_options  
varnames.extend(self.\_set\_plugin\_options(plugin\_type, variables, templar, task\_keys))  
File “/home/srv\_22/.local/lib/python3.10/site-packages/ansible/executor/task\_executor.py”, line 1008, in \_set\_plugin\_options  
plugin = getattr(self.\_connection, plugin\_type)  
File “/home/srv\_22/.ansible/collections/ansible\_collections/ansible/netcommon/plugins/plugin\_utils/connection\_base.py”, line 50, in **getattr**  
raise AttributeError(  
AttributeError: ‘Connection’ object has no attribute ‘nonetype’  
fatal: [PE1]: FAILED! =\> {  
“msg”: “Unexpected failure during module execution: ‘Connection’ object has no attribute ‘nonetype’”,  
“stdout”: “”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
PE1 : ok=2 changed=0 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0

Ansible task :

############################# nokia ##############################################

- name: configuration des interfaces nk\_sr  
template:  
src: templates/interface\_conf\_nk\_sr.j2  
dest: files/interfaces/PE/{{inventory\_hostname}}\_out-deploy-interfaces\_nk\_sr  
delegate\_to: localhost  
when: inventory\_hostname in groups[‘nokia\_sr\_PE’]

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [April 10, 2023, 1:08pm UTC](https://forum.ansible.com/t/erreur-ansible-nokia/37867/2 "2023-04-10T13:08:11Z")

</div>

If it’s indicated above, I missed it: Is it the “sros\_config” task (i.e. “community.network.sroc\_config”) that’s generating the traceback?

The first error appears to come from …/netcommon/plugins/plugin\_utils/connection\_base.py, but I don’t see any connection configuration in what you’ve shown us. Perhaps there’s a missing connection definition required to configure your device?

Does the generated “files/interfaces/PE/{{inventory\_hostname}}\_out-deploy-interfaces\_nk\_sr” file appear to contain the correct contents? Can you share it with us?

You might get your playbook and roles to pass ansible-lint cleanly. It’s highly opinionated about stylistic issues, but it makes you think about non-obvious issues. Highly recommended. (I don’t expect it to “fix” the problem, but the process will eliminate a lot of potential issues.)

Otherwise, I’m having a hard time coming up with suggestions.
