Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure package acl is installed as dependency #57

Merged
merged 1 commit into from
Feb 14, 2022
Merged

fix: ensure package acl is installed as dependency #57

merged 1 commit into from
Feb 14, 2022

Conversation

voroyam
Copy link
Contributor

@voroyam voroyam commented Feb 13, 2022

add acl package to owncloud_packages.

Without it my Ansible deployment fails with:

TASK [owncloud : Get ownCloud setup status] **************************************************************************************
fatal: [10.211.55.6]: 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.11/user_guide/become.html#becoming-an-unprivileged-user"}

at this step:

- name: Get ownCloud setup status
  command: "{{ owncloud_occ_executable | quote }} check"
  register: __owncloud_register_occ_check
  changed_when: False
  become: True
  become_user: "{{ owncloud_app_user }}"

verbose output

TASK [owncloud : Get ownCloud setup status] ************************************************************************************
task path: /Users/dmitry/.ansible/roles/owncloud/tasks/setup.yml:125
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'echo ~ansible && sleep 0'"'"''
<10.211.55.6> (0, b'/home/ansible\n', b'')
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /var/tmp `"&& mkdir "` echo /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500 `" && echo ansible-tmp-1644712902.600127-52457-249062905870500="` echo /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500 `" ) && sleep 0'"'"''
<10.211.55.6> (0, b'ansible-tmp-1644712902.600127-52457-249062905870500=/var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500\n', b'')
Using module file /Library/Python/3.8/site-packages/ansible/modules/command.py
<10.211.55.6> PUT /Users/dmitry/.ansible/tmp/ansible-local-515335blev2qb/tmpphoxlug7 TO /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py
<10.211.55.6> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 '[10.211.55.6]'
<10.211.55.6> (0, b'sftp> put /Users/dmitry/.ansible/tmp/ansible-local-515335blev2qb/tmpphoxlug7 /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py\n', b'')
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'setfacl -m u:www-data:r-x /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py && sleep 0'"'"''
<10.211.55.6> (127, b'', b'/bin/sh: 1: setfacl: not found\n')
<10.211.55.6> Failed to connect to the host via ssh: /bin/sh: 1: setfacl: not found
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'chmod u+x /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py && sleep 0'"'"''
<10.211.55.6> (0, b'', b'')
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'chown www-data /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py && sleep 0'"'"''
<10.211.55.6> (1, b'', b"chown: changing ownership of '/var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/': Operation not permitted\nchown: changing ownership of '/var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py': Operation not permitted\n")
<10.211.55.6> Failed to connect to the host via ssh: chown: changing ownership of '/var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/': Operation not permitted
chown: changing ownership of '/var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py': Operation not permitted
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'chmod +a '"'"'"'"'"'"'"'"'www-data allow read,execute'"'"'"'"'"'"'"'"' /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py && sleep 0'"'"''
<10.211.55.6> (1, b'', b"chmod: invalid mode: '+a'\nTry 'chmod --help' for more information.\n")
<10.211.55.6> Failed to connect to the host via ssh: chmod: invalid mode: '+a'
Try 'chmod --help' for more information.
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'chmod A+user:www-data:rx:allow /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/AnsiballZ_command.py && sleep 0'"'"''
<10.211.55.6> (1, b'', b"chmod: invalid mode: 'A+user:www-data:rx:allow'\nTry 'chmod --help' for more information.\n")
<10.211.55.6> Failed to connect to the host via ssh: chmod: invalid mode: 'A+user:www-data:rx:allow'
Try 'chmod --help' for more information.
<10.211.55.6> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.211.55.6> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/dmitry/.ansible/cp/2a4279f926 10.211.55.6 '/bin/sh -c '"'"'rm -f -r /var/tmp/ansible-tmp-1644712902.600127-52457-249062905870500/ > /dev/null 2>&1 && sleep 0'"'"''
<10.211.55.6> (0, b'', b'')
fatal: [10.211.55.6]: 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.11/user_guide/become.html#becoming-an-unprivileged-user"
}

@voroyam
Copy link
Contributor Author

voroyam commented Feb 13, 2022

error tracked down and "solved" with solution in this issue
georchestra/ansible#55

@xoxys
Copy link
Contributor

xoxys commented Feb 13, 2022

Can you add some more details on what OS/setup this issue occurs?

@voroyam
Copy link
Contributor Author

voroyam commented Feb 14, 2022

Can you add some more details on what OS/setup this issue occurs?

VM with ubuntu-20.04.3-arm64. Setup is the ubuntu minimal setup.

@xoxys
Copy link
Contributor

xoxys commented Feb 14, 2022

Ah ARM... Not sure if we want to support ARM but if thats the only issue so far Im fine to add it.

@enbrnz
Copy link
Contributor

enbrnz commented Feb 14, 2022

So I guess on other architectures the acl package is preinstalled inside the image. So it might be an implicit requirement. I am fine to add it too, to make this more resilient. 👍

add `acl` package to `owncloud_packages`.
@xoxys xoxys changed the title Update main.yml fix: ensure package acl is installed as dependency Feb 14, 2022
@xoxys xoxys merged commit b24bf6a into owncloud-ansible:master Feb 14, 2022
@xoxys
Copy link
Contributor

xoxys commented Feb 14, 2022

Thanks @voroyam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants