datastax / pulsar-ansible

Apache License 2.0
4 stars 9 forks source link

Fix split filter in `pulsar_chkCurVer` role #13

Closed MMirelli closed 1 year ago

MMirelli commented 1 year ago

Otherwise the following error manifests

    fatal: [35.91.69.83]: FAILED! => {"msg": "template error while  templating string: no filter named 'split'. String: {{ pulsar_ver_output.stdout_lines[0] | split(':') | last | trim }}"}
yabinmeng commented 1 year ago

@MMirelli what is the Python version, Ansible version and Pulsar version you're using? I've been using this many times without triggering an issue.

yabinmeng commented 1 year ago

BTW, I just tested this.

$ ansible-playbook -i hosts_MyCluster1.ini test.yaml

PLAY [localhost] ****

TASK [Gathering Facts] ** ok: [localhost]

TASK [debug] **** ok: [localhost] => { "msg": "Current version of pulsar is: 2.10.1.7" }

TASK [debug] **** ok: [localhost] => { "msg": "2.10.1.7" }

PLAY RECAP ***

MMirelli commented 1 year ago

I am using the following:

ansible --version
ansible 2.9.27
python3 --version
Python 3.6.8
pulsar version
Current version of pulsar is: 2.10.1.7
Git Revision cd73e370256623fd4b7b48975b1c09b2b137a656(dirty)
Git Branch cd73e370256623fd4b7b48975b1c09b2b137a656
Built by  <> on 30772e21e9ee at 2020-01-22T15:10:15+0000
MMirelli commented 1 year ago

I think it might be an ansible version incompatibility. What ansible version are you using?

yabinmeng commented 1 year ago

I'm using Ansible 2.13.4. The Python version in my environment is 3.7.10.

dave2wave commented 1 year ago

I've had similar issues. There should be no problems taking this version. Alternatively the whole statement can be converted to python as pulsar_ver_output.stdout_lines[0].split(':')[-1].trim()