Add management of ~/.opt
This commit is contained in:
30
user.yml
30
user.yml
@@ -208,6 +208,7 @@
|
|||||||
stat:
|
stat:
|
||||||
path: "/home/{{ user.name }}/bin"
|
path: "/home/{{ user.name }}/bin"
|
||||||
register: bin_stat
|
register: bin_stat
|
||||||
|
tags: [bin]
|
||||||
|
|
||||||
- name: remove ~/bin if not a link
|
- name: remove ~/bin if not a link
|
||||||
file:
|
file:
|
||||||
@@ -216,7 +217,36 @@
|
|||||||
when:
|
when:
|
||||||
- bin_stat.stat.exists
|
- bin_stat.stat.exists
|
||||||
- not bin_stat.stat.islnk
|
- 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
|
- name: link bin directory
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
_path=("$HOME/bin"
|
_path=("$HOME/bin"
|
||||||
|
"$HOME/.optbin
|
||||||
"/usr/local/sbin"
|
"/usr/local/sbin"
|
||||||
"/usr/local/bin"
|
"/usr/local/bin"
|
||||||
"/usr/sbin"
|
"/usr/sbin"
|
||||||
|
|||||||
Reference in New Issue
Block a user