Closed zerwes closed 3 months ago
wip ... fix-encalg-and-hashalg
task args
xpath: "/opnsense/ipsec/phase2[ikeid='1' and uniqid='eea1dcb2e051a']/hash-algorithm-option"
will fail!
but
[localhost] TASK: debug failing (debug)> task.args['xpath'] = "/opnsense/ipsec/phase2[ikeid=1 and uniqid=eea1dcb2e051a]/hash-algorithm-option"
[localhost] TASK: debug failing (debug)> redo
=> OK
strange .. this works as expected
- name: test
hosts: all
gather_facts: false
vars:
ikeid: 1
uniqid: eea1dcb2e051a
tasks:
- name: test del encryption-algorithm-option
delegate_to: localhost
community.general.xml:
path: cfg/ipsec-test1-04-encalg.xml
state: absent
pretty_print: true
xpath: "/opnsense/ipsec/phase2[ikeid='{{ ikeid }}' and uniqid='{{ uniqid }}']/encryption-algorithm-option"
but not in the test setup
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Couldn't delete xpath target: /opnsense/ipsec/phase2[ikeid='1' and uniqid='eea1dcb2e051a']/encryption-algorithm-option (module 'lxml.etree' has no attribute '_ElementStringResult')"}
seems we just have 2 options
ok: [localhost] => {"actions": {"namespaces": {}, "state": "absent", "xpath": "/opnsense/ipsec/phase2[ikeid/text()='1' and uniqid/text='eea1dcb2e051a']/encryption-algorithm-option"}, "changed": false}
In 5.1.1 lxml removed _ElementStringResult() ... :question: https://github.com/lxml/lxml/compare/lxml-5.1.0...lxml-5.1.1
currently I use: lxml 5.2.1
fck ... hours of debugging and testing for the a... ah... for nothing all works as expected w/ lxml 5.1.0 :exclamation:
ansible-collections/community.general#8435
while starting some test implementation for #67 the 2 options let some ipsec tests fail ... ... or just deprecate the old legacy stuff and implement #42