Commit 60583545 authored by Łukasz Nowak's avatar Łukasz Nowak

playbook: Relax finding of public-ipv4 file

As more then one type of ERP5ish software release can be build
with the playbook, make finding ipv4 more reliable.

Also, as there can be only one public IPv4 drop the playbook_name
namespace from the detected value.
parent 22c7af1f
......@@ -120,14 +120,9 @@ def status():
frn_sr = [q for q in software_release_list
if 'software/apache-frontend' in q][0]
zope_ip, pw = get_connection_information(erp5_sr)
if 'software/erp5' in erp5_sr:
filename = '/tmp/playbook-erp5-public-ipv4'
elif 'software/wendelin' in erp5_sr:
filename = '/tmp/playbook-wendelin-public-ipv4'
else:
raise ValueError
try:
ip = open(filename).read()
ip = open('/tmp/playbook-public-ipv4').read()
except Exception:
frontend = None
else:
......@@ -135,7 +130,6 @@ def status():
frontend = zope_ip
else:
frontend = 'https://' + ip
frontend_ip, _ = get_connection_information(frn_sr)
if zope_ip is None or frontend is None or frontend_ip is None:
......
......@@ -3,7 +3,7 @@
include_vars: erp5-common.yml
- name: Store public IPv4 for other scripts
shell: echo "{{ ansible_default_ipv4.address }}" > /tmp/playbook-{{ playbook_name }}-public-ipv4
shell: echo "{{ ansible_default_ipv4.address }}" > /tmp/playbook-public-ipv4
- name: create instance request script
template: src={{ request_instance_template }} dest=/tmp/playbook-request-{{ playbook_name }} mode=700
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment