ansible-role-dotfiles/tasks/Debian.yml

70 lines
1.7 KiB
YAML
Raw Permalink Normal View History

---
2023-11-09 14:41:01 +00:00
- import_tasks: vim.yml
2023-11-19 16:17:12 +00:00
- name: Copy the global vim configuration
ansible.builtin.copy:
src: vimrc.local
dest: /etc/vim/
2023-11-09 14:41:01 +00:00
- name: Ensure vim will source a global configuration file
ansible.builtin.blockinfile:
2023-11-19 16:17:12 +00:00
path: /etc/vim/vimrc
2023-11-09 14:41:01 +00:00
marker: '" {mark} ANSIBLE MANAGED BLOCK'
block: |
set runtimepath+=/var/lib/vim/addons
if filereadable("/etc/vimrc.local")
source /etc/vimrc.local
endif
- name: Ensure Debian sources .bash_aliases
ansible.builtin.lineinfile:
path: /root/.bashrc
# regexp: '\.bash_aliases'
line: 'source ~/.bash_aliases'
- name: Copy shell configuration
ansible.builtin.copy:
src: inputrc
dest: "{{ item }}/.inputrc"
loop:
- /etc/skel
- /root
2023-11-19 16:17:12 +00:00
- "{{ ansible_env.PWD }}/"
- name: Copy bash aliases
ansible.builtin.copy:
src: bash_aliases
dest: "{{ item }}/.bash_aliases"
loop:
- /etc/skel
- /root
- "{{ ansible_env.HOME }}/"
- name: Add root bashrc shell history configuration
lineinfile:
path: /root/.bashrc
regexp: '^(export )?HISTCONTROL='
line: 'HISTCONTROL=ignoreboth'
state: present
- name: Add root bashrc and vim configuration.
lineinfile:
path: /root/.bashrc
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: present
with_items:
- regexp: '^(export )?VISUAL='
line: 'export VISUAL=vim.basic'
- regexp: '^(export )?EDITOR='
line: 'export EDITOR=vim.basic'
- regexp: '^(export )?SUDO_EDITOR='
line: 'export SUDO_EDITOR=vim.basic'
- name: Add functional alias to restart a service and show the log
blockinfile:
path: /root/.bashrc
block: |
pheonix() {
systemctl restart $1;journalctl -fu $1
}