From 9e500285f0f31fc122ddbf7d4cef7617c728f7e4 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 23 Jan 2019 10:25:31 -0500 Subject: [PATCH] tripleo_deploy: symlink ansible-playbook In RHEL8, we'll have /usr/bin/ansible-playbook provided by ansible package. Everywhere in TripleO we rely on /usr/bin/ansible-playbook but the ansible-python3 package in Fedora 28 doesn't provide it. Until it does, we have a temporary workaround that will create a symlink only if the file doesn't exist and if ansible-playbook3 is here. Change-Id: I040345ffb76a14035e6100c4e61a9aea07b690c6 Related-Bug: #1812837 --- tripleoclient/v1/tripleo_deploy.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index 1f508fbd9..ce74e3eac 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -106,6 +106,18 @@ class Deploy(command.Command): ansible_playbook_cmd = "ansible-playbook-{}".format(python_version) python_cmd = "python{}".format(python_version) + # https://bugs.launchpad.net/tripleo/+bug/1812837 + if not os.path.exists('/usr/bin/ansible-playbook'): + if os.path.exists('/usr/bin/' + ansible_playbook_cmd): + if not os.path.exists('/usr/local/bin/ansible-playbook'): + os.symlink('/usr/bin/' + ansible_playbook_cmd, + '/usr/local/bin/ansible-playbook') + else: + if not os.path.exists('/usr/bin/' + ansible_playbook_cmd): + if not os.path.exists('/usr/local/bin/' + ansible_playbook_cmd): + os.symlink('/usr/bin/ansible-playbook', + '/usr/local/bin/' + ansible_playbook_cmd) + def _is_undercloud_deploy(self, parsed_args): return parsed_args.standalone_role == 'Undercloud' and \ parsed_args.stack == 'undercloud'