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

can not enable snap auto update after disabled it #44

Open
zerr0s opened this issue Aug 14, 2023 · 0 comments
Open

can not enable snap auto update after disabled it #44

zerr0s opened this issue Aug 14, 2023 · 0 comments

Comments

@zerr0s
Copy link

zerr0s commented Aug 14, 2023

Hello,

I have successfully installed microk8s using this role, with the snap auto update to false.
After that I have put this variable to true dans I can see an entry in the host file:

microk8s_disable_snap_autoupdate: true
# BEGIN ANSIBLE MANAGED: microk8s Disable snap autoupdate
127.0.0.1 api.snapcraft.io
# END ANSIBLE MANAGED: microk8s Disable snap autoupdate

If I want to enable the snap auto update, there is no task to remove the host entry. Something like this should works:

microk8s_disable_snap_autoupdate: false
- name: Disable snap autoupdate
  become: true
  blockinfile:
    state: "{{ 'present' if microk8s_disable_snap_autoupdate == true else 'absent' }}"
    dest: /etc/hosts
    marker: "# {mark} ANSIBLE MANAGED: microk8s Disable snap autoupdate"
    content: |
      127.0.0.1 api.snapcraft.io
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

No branches or pull requests

1 participant