Closed FuRy2K closed 7 months ago
I've made the changes on the unifi-refactor
branch https://github.com/saltyorg/Sandbox/tree/unifi-refactor
Can you test?
Got the following error. If you need further debug logs let me know.
TASK [unifi : Unifi | Import init-mongo.js] ******************************************************************************************************************************************************************** Tuesday 07 November 2023 10:30:27 -0500 (0:00:00.158) 0:00:34.661 ****** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleError: template error while templating string: expected token 'end of print statement', got 'dbname'. String: db.getSiblingDB("{{ unifi_mongo_ dbname }}").createUser({user: "{{ unifi_mongo_user }}", pwd: "{{ unifi_mongo_pass }}", roles: [{role: "dbOwner", db: "{{ unifi_mongo_dbname }}"}, {role: "dbOwner", db: "{{ unifi_mongo_dbname }}_stat"}]});. expected token 'end of print statement', got 'dbname' fatal: [localhost]: FAILED! => {"changed": false, "msg": "AnsibleError: template error while templating string: expected token 'end of print statement', got 'dbname'. String: db.getSiblingDB(\"{{ unifi_mongo_ dbname }}\").createUser({user: \"{{ unifi_mongo_user }}\", pwd: \"{{ unifi_mongo_pass }}\", roles: [{role: \"dbOwner\", db: \"{{ unifi_mongo_dbname }}\"}, {role: \"dbOwner\", db: \"{{ unifi_mongo_dbname }}_stat\"}]});. expected token 'end of print statement', got 'dbname'"}
Had a space that should not have been - Fix committed
Is the colon in the dbname needed?
Got past the init-mongo.js error.
Now getting the following
TASK [unifi : Resources | Tasks | Docker | Create Docker Container | Create Docker Container] ****************************************************************************************************************** Tuesday 07 November 2023 10:46:46 -0500 (0:00:00.123) 0:01:33.253 ****** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'unifi_docker_image_repo' is undefined. 'unifi_docker_image_repo' is undefined. 'unifi_docker_image_repo' is undefined. 'unifi_docker_image_repo' is undefined\n\nThe error appears to be in '/srv/git/saltbox/resources/tasks/docker/create_docker_container.yml': line 20, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Resources | Tasks | Docker | Create Docker Container | Create Docker Container # noqa args[module]\n ^ here\n"}
@owine you called the var unufi_docker_image_repo
@owine you called the var unufi_docker_image_repo
Make more coffee please
More coffee coming.
TASK [unifi : Resources | Tasks | Docker | Create Docker Container | Create Docker Container] ****************************************************************************************************************** Tuesday 07 November 2023 11:06:29 -0500 (0:00:00.129) 0:01:19.575 ****** fatal: [localhost]: FAILED! => {"attempts": 1, "changed": false, "msg": "Non-string value found for env option. Ambiguous env options must be wrapped in quotes to avoid them being interpreted. Key: MONGO_PORT"}
I was getting a 404 error from the Unifi container on first boot. But I renamed /opt/unifi to /opt/unifi.bak and re-ran the tag and it came up fine as a fresh install.
I then had to restore my config from backup located at /opt/unifi.bak/data/backup using Unfi's setup wizard.
I'm up and running, but it's not a simple drop in replacement.
Which begs the question of whether we do this as a unifi
tag deprecation and a new unifi-network-application
tag.
Which begs the question of whether we do this as a
unifi
tag deprecation and a newunifi-network-application
tag.
Thank you owine for your time and effort to get this app updated / upgraded. Unless you can script to move the data across youve a few options:
How do i go about testing this?
Also just looking at the role and its hard-coded the password for mongo db. Feel like this needs to be either pulled from config and/or random generated and pushed to config
As per https://info.linuxserver.io/issues/2023-09-06-unifi-controller/ the LSIO Unifi controller will be deprecated on 2024-01-01
The replacement container isn't a drop-in replacement and requires an external mongodb instance. More info here: https://github.com/linuxserver/docker-unifi-network-application#application-setup