Liberty to Mitaka upgrade fails inside deploy-config-changes.yml

Bug #1632025 reported by Bjoern
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Invalid
Wishlist
Unassigned

Bug Description

Liberty to Mitaka upgrade fails inside deploy-config-changes.yml:

PLAY [Upgrade environment/inventory configuration] ****************************

TASK: [Create an old copy of openstack_deploy] ********************************
failed: [localhost] => {"checksum": "3c87aaa1594b90273fd89783a1f5dccbd5ba5f6d", "failed": true}
msg: Could not replace file: /root/.ansible/tmp/ansible-tmp-1476116920.84-129637924756635/source to /etc/openstack_deploy.LIBERTY/openstack_user_config.yml.haproxy: [Errno 20] Not a directory

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/deploy-config-changes.retry

localhost : ok=0 changed=0 unreachable=0 failed=1

ran 2/opt/rpc-openstack/openstack-ansible/scripts/upgrade-utilities/playbooks/deploy-config-changes.yml

This is based off 13.3.4-1-ga489036 and it can be fixed with removing /etc/openstack_deploy.LIBERTY/ (it was a faile openstack_user_config.yml) and replaced by a directory /etc/openstack_deploy.LIBERTY.

We should make sure that /etc/openstack_deploy.LIBERTY is created before executing this play

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Could you explain how to reproduce this?

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

/etc/openstack_deploy.LIBERTY will be created in the deploy-config-changes because copy module is supposed to be recursively copying.

Revision history for this message
Bjoern (bjoern-t) wrote :

To reproduce this you can create a empty file at /etc/openstack_deploy.LIBERTY.
As I said, it was a conditional problem and I like to harden the playbooks in a way that they don't break if the destination is there already. Perhaps we just add a check if the destination is a directory

Changed in openstack-ansible:
importance: Undecided → Low
Revision history for this message
Andy McCrae (andrew-mccrae) wrote :

Hi BjoernT - just to clarify, a file existed already at "/etc/openstack_deploy.LIBERTY" - this was a file and not a directory, so when the copy task ran it failed to sync because it couldn't create the directory, since a file already existed where the directory should've been.

I'm not too sure what a smart approach would be.

* We could delete the file and replace it with a directory, but we run the risk of removing a potentially important file, we have no real way of telling what the deployer/operator put in that file or why it exists.
* We could fail out if the directory exists as a file - but the end result is the same (the copy fails, nothing copies and the playbook fails out) - so it seems like a pointless check.

I'm not sure what the other solution would be here, if you have some ideas happy to look into that.

Revision history for this message
Bjoern (bjoern-t) wrote :

Yes I it was a file, I would propose to add a dynamic timestamp to the backup destination.
If we determine the environment uses a Liberty config, we copy it one time to a /etc/openstack_deploy.LIBERTY.timestamp folder

Changed in openstack-ansible:
importance: Low → Wishlist
status: New → Confirmed
Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :
Revision history for this message
Mohammed Naser (mnaser) wrote :

Bug find against an unsupported old release

Changed in openstack-ansible:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.