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