diff --git a/playbooks/vars/lima-kilo.yaml b/playbooks/vars/lima-kilo.yaml index 10b83b2ca3e47d2e7947ff6e3ed5f6f85118d045..92356b079a40b1829e9fafd617ad62bcb5ff2b64 100644 --- a/playbooks/vars/lima-kilo.yaml +++ b/playbooks/vars/lima-kilo.yaml @@ -1,4 +1,5 @@ --- -lima_kilo_local_path: "{{ ansible_env.HOME }}/.local/toolforge-lima-kilo" +old_lima_kilo_local_path: "{{ ansible_env.HOME }}/.local/toolforge-lima-kilo" +lima_kilo_local_path: "{{ ansible_env.HOME }}/.toolforge-lima-kilo" lima_kilo_userconfig: "{{ lima_kilo_local_path }}/userconfig.yaml" lima_kilo_chroot: "{{ lima_kilo_local_path }}/chroot" diff --git a/roles/userconfig/tasks/main.yaml b/roles/userconfig/tasks/main.yaml index 21d5f2026c6baf037cda54f55cdd04425dd50e48..90b7b3499b13ebc62d2f2c18193e36099324d016 100644 --- a/roles/userconfig/tasks/main.yaml +++ b/roles/userconfig/tasks/main.yaml @@ -1,8 +1,8 @@ --- # migration of user config file. This code can be deleted after we know all users have migrated -- name: Verify if old config file exists '{{ ansible_env.HOME }}/.config/toolforge-lima-kilo-userconfig.yaml' +- name: Verify if old config file exists '{{ old_lima_kilo_local_path }}/userconfig.yaml' ansible.builtin.stat: - path: "{{ ansible_env.HOME }}/.config/toolforge-lima-kilo-userconfig.yaml" + path: "{{ old_lima_kilo_local_path }}/userconfig.yaml" register: filecheck_old - name: Verify if new config file exists '{{ lima_kilo_userconfig }}' @@ -25,6 +25,13 @@ mode: "0644" when: filecheck_old.stat.exists and not filecheck_new.stat.exists +# migration to the new local dir tree. This code can be removed when we know all users have moved +- name: "Ensure old local dir tree does not exist anymore for lima-kilo '{{ old_lima_kilo_local_path }}'" + become: true + ansible.builtin.file: + dest: "{{ old_lima_kilo_local_path }}" + state: "absent" + # load local user configuration variables in the local system, if present - name: Include vars from '{{ lima_kilo_userconfig }}' ansible.builtin.include_vars: "{{ lima_kilo_userconfig }}"