openwisp / ansible-openwisp-wifi-login-pages

Ansible role to deploy and manage OpenWISP WiFi Login Pages
https://openwisp.org
5 stars 7 forks source link

Authentication failure in yarn build task #36

Closed paramosr closed 8 months ago

paramosr commented 9 months ago

Hi, My server is Ubuntu 22.04 and I am trying to configure ansible-openwisp-wifi-login-pages.

I configured the playbook.yml as in the documentation:

`- hosts: openwisp-wifi-login-pages become: "{{ become | default('yes') }}" roles:

also the hosts file:

[openwisp-wifi-login-pages] openwisp-wifi-login-pages.mydomain.com when I try to run the playbook in my server, I face the following error in the yarn build task:

TASK [openwisp.wifi_login_pages : yarn build] *********************************************************************************************************************************************************************
fatal: [openwisp-wifi-login-pages.mydomain.com]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chmod: invalid mode: 'A+user:www-data:rx:allow'\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible-core/2.13/user_guide/become.html#risks-of-becoming-an-unprivileged-user"}

PLAY RECAP ********************************************************************************************************************************************************************************************************
openwisp-wifi-login-pages.mydomain.com : ok=17   changed=4    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0  

image

seems that the www-data user dont have permissions to do all yarn build task.

Also when I check the wifi-login-pages folder, seems that everything is okay. www-data is the owner and the group.

Do you know how to solve it?

Thanks, Pablo

nemesifier commented 8 months ago

This is a common ansible issue, googling this error I found this which should help:

It doesn't look like a problem with this role but rather a problem with the fact that ansible cannot manipulate the files it creates in the /tmp dir to execute the actions of the role.

I am closing because I think it's not a bug but feel free to reply here or supply more information.

paramosr commented 7 months ago

Thanks your your answer.

to fix the permissions issue, just follow the steps you mention before

Basically it is to add an install acl task in our playbook.

While fixing that, I found another error related to node, which was failing me in the yarn build step.
The error message was as follows. node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

To solve this, I just had to remove the version of node installed on the server (16 in my case) and install node 20.

By doing that, ansible wifi login pages is completed sucessfully.