computer_id = 'local_computer'
frontend_software_release_url = '{{ frontend_software_release_url }}'
supply(frontend_software_release_url, computer_id)
# frontend master partition
request(software_release=frontend_software_release_url, partition_reference='{{ frontend_master_reference }}')

# frontend slave partition
backend_url = None
try:
  backend_url = open('{{ backend_url_path }}', 'r').read()
except Exception:
  pass

if backend_url is not None:
  request(
    software_release=frontend_software_release_url,
    partition_reference='{{ frontend_slave_reference }}',
    shared=True,
    partition_parameter_kw={
        'url': backend_url,
        'type': 'zope',
        'custom_domain': '{{ ansible_default_ipv4.address }}',
        'server-alias': '*',
        'https-only': 'true'
    }
  )
