diff --git a/user.yml b/user.yml index a2b973c..3b09f85 100644 --- a/user.yml +++ b/user.yml @@ -208,6 +208,7 @@ stat: path: "/home/{{ user.name }}/bin" register: bin_stat + tags: [bin] - name: remove ~/bin if not a link file: @@ -216,7 +217,36 @@ when: - bin_stat.stat.exists - not bin_stat.stat.islnk + tags: [bin] +- name: create ~/.opt and ~/.optbin + file: + path: "{{ item }}" + state: directory + with_items: + - ~/.opt/ + - ~/.optbin/ + tags: [bin] + +- name: symlink opt programs + file: + state: link + force: true + follow: false + path: "/home/{{ user.name }}/.optbin/{{ item.name }}" + src: "/home/{{ user.name }}/.opt/{{ item.optpath }}" + owner: "{{ user.name }}" + group: "{{ user_group_name }}" + with_items: + - name: terraform + optpath: terraform + - name: kubectl + optpath: kubectl + - name: hugo + optpath: hugo + - name: drone + optpath: drone + tags: [bin] - name: link bin directory file: diff --git a/zsh/zprofile.j2 b/zsh/zprofile.j2 index 4aa81c4..f52acbc 100644 --- a/zsh/zprofile.j2 +++ b/zsh/zprofile.j2 @@ -1,4 +1,5 @@ _path=("$HOME/bin" + "$HOME/.optbin "/usr/local/sbin" "/usr/local/bin" "/usr/sbin"