gantsign / ansible-role-oh-my-zsh

Ansible role for installing and configuring oh-my-zsh
https://galaxy.ansible.com/gantsign/oh-my-zsh
MIT License
165 stars 41 forks source link

Missing acl package in oh_my_zsh_dependencies #159

Open Wolfeg opened 1 year ago

Wolfeg commented 1 year ago

If acl package is missing on system, ansible cant use setfacl, so trying chmod instead, that cant be used on another unpriveleged user with template module. More here. After installing that package on system, everything works fine

freemanjp commented 1 year ago

@Wolfeg thanks for reporting this issue. Sorry for the late reply. If I understand correctly, you're trying to run the role using an unprivileged user. Unfortunately, I don't think that'll work, the role was designed to be run by a user with root privileges to install Oh My Zsh for multiple users. In hindsight, it would probably have been better to just install Oh My Zsh for the current user without requiring root privileges, but that would be too big a breaking change at this point.

Wolfeg commented 1 year ago

I have main playbook like this:

---
- hosts: all
  ## I use become to get sudo rights
  become: yes
  roles:
    - ssh-users
    - sshd-config
    - tz-data
    - cloudalchemy.node_exporter

inside ssh-users role i have task:

- name: Installing oh my zsh
  include_role:
    name: gantsign.oh-my-zsh

and inside ssh-users role defaults:

users:
  - username: user1
    admin: yes
    oh_my_zsh:
      theme: fino-time
      plugins:
          - git
          - z
      update_mode: auto
      update_frequency: 0
  - username: user2
    admin: yes
    oh_my_zsh:
      theme: fino-time
      plugins:
          - git
          - z
      update_mode: auto
      update_frequency: 0
  - username: root
    oh_my_zsh:
      theme: fino-time
      plugins:
          - git
          - z
      update_mode: auto
      update_frequency: 0

I can't remember what error gave me ansible, that was something about acl. I run playbooks under user with sudo group. I've fixed it with this additional task:

- name: Install acl
  apt:
    name: acl
    update_cache: yes