canonical / maas-ansible-playbook

An Ansible playbook for installing and configuring MAAS
Apache License 2.0
44 stars 34 forks source link

Cannot install standalone MAAS Region using Deb #142

Open SK1Y101 opened 1 year ago

SK1Y101 commented 1 year ago

Describe the bug Attempted with a fresh LXD container with maas-test-db installed alongside. Deploying only a MAAS region as snap works perfectly fine. Deploying a MAAS region as deb throws a large error relating to missing ipv4/ipv6 addresses of a postgres db.

tl;dr the playbook expects you to have a postgres host attached when writing regiond.conf

Reproducing Provide the following, limited to relevant sections

  1. Hosts file
    ---
    all:
    children:
    maas_postgres:
    maas_pacemaker:
      children:
        maas_corosync:
    maas_postgres_proxy:
    maas_proxy:
    maas_region_controller:
        10.10.0.20
    maas_rack_controller:
  2. Execution command
    ansible-playbook -i ./hosts.yaml --extra-vars="maas_version=3.4 maas_postgres_password=example maas_installation_type=deb maas_url=http://10.10.0.20:5240/MAAS ansible_user=ubuntu maas_postgres_uri=maas-test-db:///" ./site.yaml -vv
  3. Playbook output
    TASK [maas_region_controller : Update regiond.conf] ****************************
    task path: /home/skiy/GitHub/maas-ansible-playbook/roles/maas_region_controller/tasks/install_maas.yaml:33
    An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: {{ hostvars[groups['maas_postgres'][0]]['ansible_default_ipv6']['address']|d('') }}: list object has no element 0. list object has no element 0. {{ hostvars[groups['maas_postgres'][0]]['ansible_default_ipv6']['address']|d('') }}: list object has no element 0. list object has no element 0
    fatal: [10.10.0.20]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: {{ hostvars[groups['maas_postgres'][0]]['ansible_default_ipv6']['address']|d('') }}: list object has no element 0. list object has no element 0. {{ hostvars[groups['maas_postgres'][0]]['ansible_default_ipv6']['address']|d('') }}: list object has no element 0. list object has no element 0"}

Expected behaviour Deb should be able to complete install as Snap does.