Error when deploy Ovirt4.4 Hosted Engine

Hello, I get error, need help. [ ERROR ] fatal: [localhost]: FAILED! => {"msg": "The conditional check 'not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0' failed. The error was: error while evaluating conditional (not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0): 'dict object' has no attribute 'dst'\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/ovirt/ovirt/roles/hosted_engine_setup/tasks/bootstrap_local_vm/01_prepare_routing_rules.yml': line 81, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n changed_when: true\n - name: Add IPv4 inbound route rules\n ^ here\n"}

On Sun, Feb 12, 2023 at 10:39 PM <staybox@gmail.com> wrote:
Hello, I get error, need help.
[ ERROR ] fatal: [localhost]: FAILED! => {"msg": "The conditional check 'not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0' failed. The error was: error while evaluating conditional (not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0): 'dict object' has no attribute 'dst'\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/ovirt/ovirt/roles/hosted_engine_setup/tasks/bootstrap_local_vm/01_prepare_routing_rules.yml': line 81, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n changed_when: true\n - name: Add IPv4 inbound route rules\n ^ here\n"}
A wild guess: The code adds a rule to the routing policy table, with priority 100 and dst equal to your IP address, but tries to do this only if it's not already done. But in reality it was probably never tested on a machine already having a rule with priority 100 and no 'dst'. Perhaps that's your case? What's the output of: $ ip -j rule | jq '' If it includes a rule with priority 100 and no 'dst', and if you can remove it, or add a 'dst', perhaps try that. Perhaps create an issue on the ovirt-ansible-collection project with all relevant details. Best regards, -- Didi

Hello, I see: ip -j rule | jq '' [ { "priority": 0, "src": "all", "table": "local" }, { "priority": 100, "src": "10.55.8.0", "srclen": 24, "table": "500" }, { "priority": 101, "src": "192.168.222.1", "srclen": 24, "table": "main" }, { "priority": 101, "src": "192.168.1.1", "srclen": 24, "table": "main" }, { "priority": 32766, "src": "all", "table": "main" }, { "priority": 32767, "src": "all", "table": "default" } ] пн, 13 февр. 2023 г. в 10:43, Yedidyah Bar David <didi@redhat.com>:
On Sun, Feb 12, 2023 at 10:39 PM <staybox@gmail.com> wrote:
Hello, I get error, need help.
[ ERROR ] fatal: [localhost]: FAILED! => {"msg": "The conditional check
'not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0' failed. The error was: error while evaluating conditional (not ipv6_deployment|bool and route_rules_ipv4.stdout | from_json | selectattr('priority', 'equalto', 100) | selectattr('dst', 'equalto', virbr_cidr_ipv4 | ipaddr('address') ) | list | length == 0): 'dict object' has no attribute 'dst'\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/ovirt/ovirt/roles/hosted_engine_setup/tasks/bootstrap_local_vm/01_prepare_routing_rules.yml': line 81, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n changed_when: true\n - name: Add IPv4 inbound route rules\n ^ here\n"}
A wild guess: The code adds a rule to the routing policy table, with priority 100 and dst equal to your IP address, but tries to do this only if it's not already done. But in reality it was probably never tested on a machine already having a rule with priority 100 and no 'dst'. Perhaps that's your case? What's the output of:
$ ip -j rule | jq ''
If it includes a rule with priority 100 and no 'dst', and if you can remove it, or add a 'dst', perhaps try that.
Perhaps create an issue on the ovirt-ansible-collection project with all relevant details.
Best regards, -- Didi

ip -j rule | jq '' [ { "priority": 0, "src": "all", "table": "local" }, { "priority": 100, "src": "10.55.8.0", "srclen": 24, "table": "500" }, { "priority": 101, "src": "192.168.222.1", "srclen": 24, "table": "main" }, { "priority": 101, "src": "192.168.1.1", "srclen": 24, "table": "main" }, { "priority": 32766, "src": "all", "table": "main" }, { "priority": 32767, "src": "all", "table": "default" } ]

I solved this issue issue after modifying priority of enp8s devices on my machine by nmcli command as below. Because creating virbr0 device by ansible playbook requires priority 100. $ nmcli connection modify conn2 ipv4.routes "enp8s0 table=202" ipv4.routing-rules "priority 100 from 192.168.2.171 table 202"
participants (4)
-
Moon Jack
-
staybox@gmail.com
-
Yedidyah Bar David
-
Андрей Ваник