Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1955573

Summary: Backup and Restore: Backup openstack client integration - openstack backup with incorrect inventory should give proper error message
Product: Red Hat OpenStack Reporter: myadla
Component: tripleo-ansibleAssignee: Juan Badia Payno <jbadiapa>
Status: CLOSED ERRATA QA Contact: Sree <skovili>
Severity: low Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: elicohen, jbadiapa, jlarriba, jpretori, myadla, nweinber, skovili
Target Milestone: z2Keywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-12.6.1-2.20220114104840.db6a328.el8ost tripleo-ansible-0.8.1-2.20220112214927.5e744eb.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-23 22:10:08 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: 1824806    

Description myadla 2021-04-30 12:19:34 UTC
Description of problem:
 Backup and Restore: Backup openstack client integration - openstack backup with incorrect inventory should give proper error message

Negative test is failing as expected however the error message doesn't give any instructions to resolve this.

Version-Release number of selected component (if applicable):RHOS-16.2-RHEL-8-20210420.n.0, tripleo-ansible-0.6.1-2.20210323013845.00f09d9.el8ost.1.noarch

How reproducible:100%

Steps to Reproduce:
1.Create inventory file without nfs server in it
/home/stack/inventory-new.yaml
(Name should not be tripleo-inventory)
2.Run 
$ openstack undercloud backup --setup-nfs

(undercloud) [stack@undercloud-0 ~]$ mv tripleo-inventory.yaml test-inventory.yaml                                     │
(undercloud) [stack@undercloud-0 ~]$ openstack undercloud backup --setup-nfs                                           │
Using /tmp/prepare-nfs-backup.yaml2eakwpz0ansible.cfg as config file                                                   │
[WARNING]: Unable to parse /home/stack/tripleo-inventory.yaml as an inventory source                                   │
[WARNING]: No inventory was parsed, only implicit localhost is available                                               │
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match  │
'all'                                                                                                                  │
[WARNING]: Could not match supplied host pattern, ignoring: BackupNode                                                 │
                                                                                                                       │
PLAY [TripleO BackupNode NFS installation and configuration.] *********************************************************│
skipping: no hosts matched                                                                                             │
                                                                                                                       │
PLAY RECAP ************************************************************************************************************│
                                                                                                                       │
/usr/share/ansible/tripleo-playbooks/prepare-nfs-backup.yaml did not complete successfully.                            │
Ansible playbook execution failed: ['ansible-playbook-3', '-u', 'root', '-i', '/home/stack/tripleo-inventory.yaml', '-v│
', '-t bar_setup_nfs_server', '-c', 'smart', '/usr/share/ansible/tripleo-playbooks/prepare-nfs-backup.yaml'].          │
(undercloud) [stack@undercloud-0 ~]$         

Actual results: Fail but there are no instructions found to resolve this

Expected results: Fail - Expecting message that inventory file could not be found with the expected name and instructions on resolving this


Additional info:

Comment 7 Sree 2022-03-02 18:40:06 UTC
Verified on 16.2 by not providing an NFS server address and below message was observed.

TASK [File shared server group exists and it has at least one server] ************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "assertion": "nfs_server_group_name | default(\"BackupNode\") in groups",
    "changed": false,
    "evaluated_to": false,
    "msg": "There is no server on BackupNode groups"
}

PLAY RECAP ***********************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

/usr/share/ansible/tripleo-playbooks/prepare-nfs-backup.yaml did not complete successfully.
Ansible playbook execution failed: ['ansible-playbook-3', '-u', 'root', '-i', '/home/stack/tripleo-inventory.yaml', '-v', '-t bar_setup_nfs_server', '-c', 'smart', '/usr/share/ansible/tripleo-playbooks/prepare-nfs-backup.yaml'].
(undercloud) [stack@undercloud-0 ~]$ exit
logout

Comment 12 errata-xmlrpc 2022-03-23 22:10:08 UTC
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 (Release of components for Red Hat OpenStack Platform 16.2.2), 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/RHBA-2022:1001