Closed rparree closed 1 year ago
Same here.
Thank you, will check in next week.
I fixed it inside templates/zshrc.j2
with:
# hotkeys
{% for hotkey in zsh_hotkeys %}
{% if 'hotkey' in hotkey and hotkey.hotkey != '' and (hotkey.bundle is not defined or hotkey.bundle in bundles_enabled) %}
bindkey '{{ hotkey.hotkey }}' {{ hotkey.action }}
{% endif %}
{% endfor %}
But facing other issues with bundles when using ubuntu-22-04-x64
release... Just removing the bundle section for now.
I created a pull request on this https://github.com/viasite-ansible/ansible-role-zsh/pull/64
this pull fixed more related issues https://github.com/viasite-ansible/ansible-role-zsh/pull/69
I tried the pull request, thank you @quantumfate . For me it works, without it the role is useless as it fails or produces incorrect outputs
this pull fixed more related issues #69
This is the one. I manually applied the changes myself (I'm not sure how else to do it until the PR is approved and merged) and it works perfectly on Ubuntu 22.04.1.
Thank you, @quantumfate!
any progress on merging the PR?
Cool PR! Thank you. For hot fix without patching source code of role. You can add variable zsh_hotkeys
For example
zsh_hotkeys:
- { hotkey: '^r', action: 'fzf-history' }
# with dependency of bundle
- { hotkey: '`', action: autosuggest-accept, bundle: zsh-users/zsh-autosuggestions }
And after this action role from ansible-galaxy will work fine.
Still failing with Ansible 2.14.3
.
TASK [viasite-ansible.zsh : Write .zshrc config] ********************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'str object' has no attribute 'hotkey'. 'str object' has no attribute 'hotkey'
fatal: [ryzen5]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'str object' has no attribute 'hotkey'. 'str object' has no attribute 'hotkey'"}
I did add zsh_hotkeys
, no impact.
zsh_hotkeys:
- { hotkey: '^r', action: 'fzf-history' }
- { hotkey: '^ ', action: autosuggest-accept, bundle: zsh-users/zsh-autosuggestions }
Full trace
The full traceback is:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.10/site-packages/ansible/template/__init__.py", line 987, in do_template
res = self.environment.concat(rf)
File "/home/username/.local/lib/python3.10/site-packages/ansible/template/native_helpers.py", line 88, in ansible_concat
return ''.join([to_text(v) for v in nodes])
File "/home/username/.local/lib/python3.10/site-packages/ansible/template/native_helpers.py", line 88, in <listcomp>
return ''.join([to_text(v) for v in nodes])
File "<template>", line 202, in root
File "/usr/lib/python3.10/site-packages/jinja2/runtime.py", line 852, in _fail_with_undefined_error
raise self._undefined_exception(self._undefined_message)
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'hotkey'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.10/site-packages/ansible/plugins/action/template.py", line 141, in run
resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False)
File "/home/username/.local/lib/python3.10/site-packages/ansible/template/__init__.py", line 1021, in do_template
raise AnsibleUndefinedVariable(e, orig_exc=e)
ansible.errors.AnsibleUndefinedVariable: 'str object' has no attribute 'hotkey'. 'str object' has no attribute 'hotkey'
fatal: [ryzen5]: FAILED! => {
"changed": false,
"msg": "AnsibleUndefinedVariable: 'str object' has no attribute 'hotkey'. 'str object' has no attribute 'hotkey'"
}
Fixed, thank you, sorry for a long ignoring.
The role is throwing an error when running with Ansible 2.13.1:
When i downgrade to 2.12.3 then it works again.