From f902fc122fd2b478aa33f8d35dbd3119b468c1e9 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Tue, 22 Feb 2022 11:05:48 +0100 Subject: [PATCH] toansible: Add bash installation --- configs.yml | 14 ----------- .../bash => roles/bash/files}/bash_profile | 0 {dotfiles/bash => roles/bash/files}/bashrc | 0 {dotfiles/bash => roles/bash/files}/inputrc | 0 roles/bash/tasks/main.yml | 25 +++++++++++++++++++ 5 files changed, 25 insertions(+), 14 deletions(-) rename {dotfiles/bash => roles/bash/files}/bash_profile (100%) rename {dotfiles/bash => roles/bash/files}/bashrc (100%) rename {dotfiles/bash => roles/bash/files}/inputrc (100%) create mode 100644 roles/bash/tasks/main.yml diff --git a/configs.yml b/configs.yml index a003907..e7eba44 100644 --- a/configs.yml +++ b/configs.yml @@ -24,20 +24,6 @@ grub: sudo sed -i -E 's/^#?GRUB_DISABLE_SUBMENU.+/GRUB_DISABLE_SUBMENU=y/' /etc/default/grub && sudo grub-mkconfig -o /boot/grub/grub.cfg -bash: - - install: - - bash-completion - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/bash/bash_profile'; grep "$content" "$HOME"/.bash_profile >/dev/null 2>&1 || echo "$content" >> "$HOME"/.bash_profile - - run: - - content='. "$HOME"/setup-cockpit/dotfiles/bash/bashrc'; grep "$content" "$HOME"/.bashrc >/dev/null 2>&1 || echo "$content" >> "$HOME"/.bashrc - - symlink: - - dotfiles/bash/inputrc - - ~/.inputrc - - clone: - - https://github.com/magicmonty/bash-git-prompt.git - - ~/.bash-git-prompt - git: - install: - git diff --git a/dotfiles/bash/bash_profile b/roles/bash/files/bash_profile similarity index 100% rename from dotfiles/bash/bash_profile rename to roles/bash/files/bash_profile diff --git a/dotfiles/bash/bashrc b/roles/bash/files/bashrc similarity index 100% rename from dotfiles/bash/bashrc rename to roles/bash/files/bashrc diff --git a/dotfiles/bash/inputrc b/roles/bash/files/inputrc similarity index 100% rename from dotfiles/bash/inputrc rename to roles/bash/files/inputrc diff --git a/roles/bash/tasks/main.yml b/roles/bash/tasks/main.yml new file mode 100644 index 0000000..c360696 --- /dev/null +++ b/roles/bash/tasks/main.yml @@ -0,0 +1,25 @@ +--- + +- name: Install bash-completion (Archlinux) + become: true + pacman: + name: + - bash-completion + when: ansible_distribution == 'Archlinux' + +- name: Install bash-completion (Debian) + become: true + apt: + name: + - bash-completion + when: ansible_distribution == 'Debian' + +- name: Copy files + copy: src={{ item.src }} dest={{ item.dest }} backup=true + with_items: + - { src: 'inputrc', dest: '~/.inputrc' } + - { src: 'bash_profile', dest: '~/.bash_profile' } + - { src: 'bashrc', dest: '~/.bashrc' } + +- name: Clone bash-git-prompt + command: git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt