From 4c7c0d9e40ba2da5500516601ccf67864436d6b5 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 15 Nov 2019 21:29:38 +0000 Subject: [PATCH] Add role for custom commands --- dotfiles.yml | 1 + .../.local/bin => roles/bin/files}/vboxmount | 0 roles/bin/tasks/main.yml | 15 +++++++++++++++ .../.local => roles/git/files}/bin/git-churn | 0 .../files}/bin/git-what-the-hell-just-happened | 0 {dotfiles/.local => roles/git/files}/bin/git-wtf | 0 roles/git/tasks/main.yml | 14 ++++++++++++++ 7 files changed, 30 insertions(+) rename {dotfiles/.local/bin => roles/bin/files}/vboxmount (100%) create mode 100644 roles/bin/tasks/main.yml rename {dotfiles/.local => roles/git/files}/bin/git-churn (100%) rename {dotfiles/.local => roles/git/files}/bin/git-what-the-hell-just-happened (100%) rename {dotfiles/.local => roles/git/files}/bin/git-wtf (100%) diff --git a/dotfiles.yml b/dotfiles.yml index 963ddac..7a19a57 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -6,6 +6,7 @@ xdg_cache_home: "~/.cache" xdg_data_home: "~/.local/share" roles: + - bin - bash - dircolors - git diff --git a/dotfiles/.local/bin/vboxmount b/roles/bin/files/vboxmount similarity index 100% rename from dotfiles/.local/bin/vboxmount rename to roles/bin/files/vboxmount diff --git a/roles/bin/tasks/main.yml b/roles/bin/tasks/main.yml new file mode 100644 index 0000000..8950d0d --- /dev/null +++ b/roles/bin/tasks/main.yml @@ -0,0 +1,15 @@ +--- +- name: Create local bin directory + file: + path: ~/.local/bin + state: directory + +- name: Deploy local commands + file: + src: "{{ item }}" + dest: "~/.local/bin/{{ item | basename }}" + state: link + force: yes + with_fileglob: + - ./* + diff --git a/dotfiles/.local/bin/git-churn b/roles/git/files/bin/git-churn similarity index 100% rename from dotfiles/.local/bin/git-churn rename to roles/git/files/bin/git-churn diff --git a/dotfiles/.local/bin/git-what-the-hell-just-happened b/roles/git/files/bin/git-what-the-hell-just-happened similarity index 100% rename from dotfiles/.local/bin/git-what-the-hell-just-happened rename to roles/git/files/bin/git-what-the-hell-just-happened diff --git a/dotfiles/.local/bin/git-wtf b/roles/git/files/bin/git-wtf similarity index 100% rename from dotfiles/.local/bin/git-wtf rename to roles/git/files/bin/git-wtf diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 294c5e1..cb2727d 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -14,3 +14,17 @@ - config - ignore +- name: Create bin directory for additional git commands + file: + path: ~/.local/bin + state: directory + +- name: Deploy additional git commands + file: + src: "{{ item }}" + dest: "~/.local/bin/{{ item | basename }}" + state: link + force: yes + with_fileglob: + - ./bin/* +