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

Disabled updated #121

Closed jeop10 closed 1 year ago

jeop10 commented 2 years ago

Hello!

Thank you for your work, I just have one question: I noticed that on the lines 30 and 31 of the templates/zshrc.j2 does not match with the current .zshrc file on the ohmyzsh repo, so I was wondering if it's ok to create a PR that enables the updates? Or if its better just to leave it as it's.

https://github.com/gantsign/ansible-role-oh-my-zsh/blob/d4e4460efb3f1c0b24cd959bc1fdcd15d4568733/templates/zshrc.j2#L30-L31

Kindest regards

freemanjp commented 2 years ago

@jeop10 you're right that zshrc.j2 hasn't been updated in a while (and probably should be). But the DISABLE_AUTO_UPDATE="true" is actually intentional, so all changes of Oh My Zsh are done using Ansible. I'd accept a PR to make it configurable, but the default should be false.

jeop10 commented 2 years ago

Thanks for the reply!

I will try to make a PR this weekend, it will be my first commit to a public ansible role, all the code that I have right now its just to learn 😅

Kindest regards.

roib20 commented 1 year ago

This issue is still present.

The latest versions of oh-my-zsh recommend using zstyle ':omz:update' instead of environment variables to configure OMZ's auto-update behavior. My accepted pull request #148 brings this behavior to zshrc.j2 (in line with the current oh-my-zsh zshrc template). The current zshrc.j2 has these lines:

# Uncomment one of the following lines to change the auto-update behavior
zstyle ':omz:update' mode disabled  # disable automatic updates
# zstyle ':omz:update' mode auto      # update automatically without asking
# zstyle ':omz:update' mode reminder  # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

The configured behavior for this Role is still for auto-updates to be disabled: zstyle ':omz:update' mode disabled. If this feature were to be implemented there should be a choice between disabled, auto, or reminder, as well as an option to configure the frequency (in days).

@jeop10 if you still want to work on this I would personally appreciate it. If not, I could take a look into implementing it myself.

As a side-note gantsign/ansible_role_antigen already has this feature. However that role has a Deprecation Notice since Antigen is no longer maintained.

jeop10 commented 1 year ago

@roib20 Thank you for your work.

I am sorry I completely forgot I opened this issue, I have made a draft to see If I understand your idea. Here is the PR https://github.com/gantsign/ansible-role-oh-my-zsh/pull/156

Also I need to test this but I don't have time today.

Kindest regards.

roib20 commented 1 year ago

@jeop10 Great work! Thank you for contributing. I have looked at your revised pull request. I think another thing that can be added is changing the auto-update frequency (in days). I'm talking about this line:

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

This line needs to uncommented and the "13" should be a var. The default needs to be 13 days so that the OMZ auto-updater checks for updates every 13 days, but a user should be able to change this through the oh_my_zsh.update_frequency var (for example oh_my_zsh.update_frequency: 1 to check for an update every day, or oh_my_zsh.update_frequency: 0 to check for an update every time a shell session is started - this might help with testing).

If you prefer not to work on this I can add it as a separate pull request after your current PR #156 gets merged.

jeop10 commented 1 year ago

@roib20 Thank you!

I have just made some changes to implement your proposal. Review #156 to see the latest changes.

Please do let me know if I understood something wrong or any chances are needed.

Kindest regards.