viasite-ansible / ansible-role-zsh

Setup antigen with oh-my-zsh, powerlevel10k theme, fzf, autosuggestions, syntax-highlighting
https://habrahabr.ru/post/323496/
MIT License
342 stars 84 forks source link

create direcoty ~test1/.antigen #74

Open x4IPx opened 1 year ago

x4IPx commented 1 year ago

Hello. When running ansible-playbook OhMyZSH.yml --limit=MyHome

---
- hosts: all
  vars:
    # your extra bundles here
    zsh_antigen_bundles_extras: []
    # your variables here
    # zsh_autosuggestions_bind_key: "^U"
  roles:
    - { role: viasite-ansible.zsh, zsh_user: test1 }
    #    - viasite-ansible.zsh

I'm getting an error.

PLAY [all] ******************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************************************************************
ok: [myunit1-minipc-home]
ok: [u1-g6]

TASK [viasite-ansible.zsh : include_tasks] **********************************************************************************************************************************************************************
included: /home/fly/MyAnsible/roles/viasite-ansible.zsh/tasks/install.yml for u1-g6, myunit1-minipc-home

TASK [viasite-ansible.zsh : Update package cache] ***************************************************************************************************************************************************************
changed: [u1-g6]
changed: [myunit1-minipc-home]

TASK [viasite-ansible.zsh : Install zsh, git, wget, fd-find] ****************************************************************************************************************************************************
ok: [u1-g6]
ok: [myunit1-minipc-home]

TASK [viasite-ansible.zsh : check if ~test1/.antigen exist] *****************************************************************************************************************************************************
ok: [u1-g6]
ok: [myunit1-minipc-home]

TASK [viasite-ansible.zsh : create direcoty ~test1/.antigen] ****************************************************************************************************************************************************
fatal: [myunit1-minipc-home]: 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:test1:rx:allow’\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible-core/2.15/playbook_guide/playbooks_privilege_escalation.html#risks-of-becoming-an-unprivileged-user#risks-of-becoming-an-unprivileged-user"}
fatal: [u1-g6]: 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:test1:rx:allow'\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible-core/2.15/playbook_guide/playbooks_privilege_escalation.html#risks-of-becoming-an-unprivileged-user#risks-of-becoming-an-unprivileged-user"}

PLAY RECAP ******************************************************************************************************************************************************************************************************
myunit1-minipc-home        : ok=5    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
u1-g6                      : ok=5    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Please pay attention to create direcoty ~test1/.antigen and check if ~test1/.antigen exist]. I assume that the role does not form the path correctly.

Ошибка возникает на: Ubuntu Desktop 22.04.1 and Ubuntu Server 22.04.3

popstas commented 4 months ago

Hello, sorry for late answer. Two ways to fix it:

  1. Add remote_user: root to playbook
  2. Run ansible-playbook with -K

Some tasks of role requires superuser permissions (only install packages as I remember).

But in your output I see that install packages task was changed. I don't know why.

Syntax ~user is the same as /home/user.