Bug 1540881
Summary: | [CEE/SD] monitor_interface with "-" in the name fails with "msg": "'dict object' has no attribute u'ansible_bond-monitor-interface'" | ||
---|---|---|---|
Product: | [Red Hat Storage] Red Hat Ceph Storage | Reporter: | Tomas Petr <tpetr> |
Component: | Ceph-Ansible | Assignee: | Rishabh Dave <ridave> |
Status: | CLOSED ERRATA | QA Contact: | Vasishta <vashastr> |
Severity: | medium | Docs Contact: | John Brier <jbrier> |
Priority: | medium | ||
Version: | 3.0 | CC: | adeza, agunn, anharris, aschoen, assingh, ceph-eng-bugs, ceph-qe-bugs, dsavinea, gabrioux, gmeno, jbrier, mamccoma, nthomas, ridave, sankarshan, sdudhgao, shan, tchandra, tpetr, tserlin |
Target Milestone: | z2 | ||
Target Release: | 3.2 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | RHEL: ceph-ansible-3.2.9-1.el7cp Ubuntu: ceph-ansible_3.2.9-2redhat1 | Doc Type: | Bug Fix |
Doc Text: |
.Ceph Ansible no longer fails if network interface names include dashes
When `ceph-ansible` makes an inventory of network interfaces if they have a dash (`-`) in the name the inventory must convert the dashes to undescores (`_`) in order to use them. In some cases conversion did not occur and Ceph installation failed. With this update to {product}, all dashes in the names of network interfaces are converted in the facts and installation completes successfully.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2019-04-30 15:56:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1629656 |
Description
Tomas Petr
2018-02-01 09:19:54 UTC
Fix is upstream already. This will be in 3.1 Hello Sebastian, I tried to test the issue by reproducing it in my lab environment with ceph-ansible version 3.2. I experienced below error during deployment : TASK [ceph-validate : fail if br-ex is not active on servesha-ceph-test2] ********************************************* task path: /usr/share/ceph-ansible/roles/ceph-validate/tasks/check_eth_mon.yml:8 Tuesday 15 January 2019 04:47:00 -0500 (0:00:00.077) 0:00:21.305 ******* META: noop META: noop fatal: [servesha-ceph-test2]: FAILED! => { "msg": "The conditional check 'not hostvars[inventory_hostname]['ansible_' + monitor_interface]['active']' failed. The error was: error while evaluating conditional (not hostvars[inventory_hostname]['ansible_' + monitor_interface]['active']): 'ansible.vars.hostvars.HostVarsVars object' has no attribute u'ansible_br-ex'\n\nThe error appears to have been in '/usr/share/ceph-ansible/roles/ceph-validate/tasks/check_eth_mon.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"fail if {{ monitor_interface }} is not active on {{ inventory_hostname }}\"\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n" } # rpm -qa | grep ansible ansible-2.6.11-1.el7ae.noarch ceph-ansible-3.2.0-1.el7cp.noarch The bug was expected to be fixed in version 3.1 but it's still there in version 3.2. Regards, Servesha Indeed, it appears that's still a problem. Rishabh please look into this when you have a moment. Thanks. (In reply to Servesha from comment #5) > Hello Sebastian, > > I tried to test the issue by reproducing it in my lab environment with > ceph-ansible version 3.2. > I experienced below error during deployment : > > TASK [ceph-validate : fail if br-ex is not active on servesha-ceph-test2] > ********************************************* > task path: > /usr/share/ceph-ansible/roles/ceph-validate/tasks/check_eth_mon.yml:8 > Tuesday 15 January 2019 04:47:00 -0500 (0:00:00.077) 0:00:21.305 > ******* > META: noop > META: noop > fatal: [servesha-ceph-test2]: FAILED! => { > "msg": "The conditional check 'not > hostvars[inventory_hostname]['ansible_' + monitor_interface]['active']' > failed. The error was: error while evaluating conditional (not > hostvars[inventory_hostname]['ansible_' + monitor_interface]['active']): > 'ansible.vars.hostvars.HostVarsVars object' has no attribute > u'ansible_br-ex'\n\nThe error appears to have been in > '/usr/share/ceph-ansible/roles/ceph-validate/tasks/check_eth_mon.yml': line > 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax > problem.\n\nThe offending line appears to be:\n\n\n- name: \"fail if {{ > monitor_interface }} is not active on {{ inventory_hostname }}\"\n ^ > here\nWe could be wrong, but this one looks like it might be an issue > with\nmissing quotes. Always quote template expression brackets when > they\nstart a value. For instance:\n\n with_items:\n - {{ foo > }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n" > } > > # rpm -qa | grep ansible > ansible-2.6.11-1.el7ae.noarch > ceph-ansible-3.2.0-1.el7cp.noarch > > > The bug was expected to be fixed in version 3.1 but it's still there in > version 3.2. > > > Regards, > Servesha So the task that causes this fail is Task in ceph-validate TASK [ceph-validate : fail if br-ex is not active on servesha-ceph-test2] in ./roles/ceph-validate/tasks/check_eth_mon.yml and ./roles/ceph-validate/tasks/check_eth_rgw.yml this was added in ceph-ansible 3.2 beta https://github.com/ceph/ceph-ansible/commit/235d1b3f557dcd9164d392050382398e1cda7084#diff-3f1cf80769de29dc34cad67d08a71ee9 I think this can be fixed by adding the same parts of code as in original issue https://github.com/ceph/ceph-ansible/pull/2078/files like (and same for check_eth_rgw.yml) ----------- # cat ./roles/ceph-validate/tasks/check_eth_mon.yml --- - name: "fail if {{ monitor_interface }} does not exist on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} does not exist on {{ inventory_hostname }}" when: - monitor_interface not in ansible_interfaces - name: "fail if {{ monitor_interface }} is not active on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} is not active on {{ inventory_hostname }}" when: - not hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['active'] - name: "fail if {{ monitor_interface }} does not have any ip v4 address on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} does not have any IPv4 address on {{ inventory_hostname }}" when: - ip_version == "ipv4" - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv4'] is not defined - name: "fail if {{ monitor_interface }} does not have any ip v6 address on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} does not have any IPv6 address on {{ inventory_hostname }}" when: - ip_version == "ipv6" - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv6'] is not defined ----------- Seb, can you confirm my thoughts? btw all I did was replace ['ansible_' + monitor_interface] for ['ansible_' + (monitor_interface | replace('-', '_'))] Hello, I made changes as mentioned in the upstream (made changes in file ./roles/ceph-validate/tasks/check_eth_mon.yml). After making changes playbook is giving errors at same task (TASK [ceph-validate : fail if br-ex is not active on servesha-ceph-test2]) as it was giving previously. Best regards, Servesha Hello gabrioux, I have bridge created on node ssd1. ssd2 is my admin node and also mon,mgr and osd. ssd3 is purely osd node. I have made changes in file /usr/share/ceph-ansible/roles/ceph-validate/tasks/check_eth_mon.yml as mentioned in upstream. Expected results are : error occurrence while deploying monitor on node which contains br-ex network interface. Here are my credentials of containerized cluster. 10.74.253.96 ssd2 - admin 10.74.254.21 ssd3 10.74.250.60 ssd1 ssd1 won't be accessible through ssh since it has br-ex. Best regards, Servesha @Servesha The patch is working fine however the task is failling because your br-ex interface is down (active=false). Could you try to set the interface up and rerun ceph-ansible ? $ ip link set br-ex up Hello Dimitri, Yeah sure. I will try and rerun the playbook. Regards, Servesha Any update on this ? Hello Dimitri , I was using that environment for different task testing, it is not available now. But since the patch is working, I have notified the customer to test workaround and let us know the results. The case is now "WOC". Thank you Best Regards, Servesha Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:0911 Hi, sorry for the late reply. I've made a slight change in the last sentence. I've replaced "converted in the inventory" by "converted in the facts" since that is more accurate. |