templier-ansible/roles/cli-utils/tasks/main.yml

54 lines
1.2 KiB
YAML
Raw Normal View History

2021-01-29 00:08:39 +00:00
---
- name: Install cli utilities
package:
name:
- bash
- bash-completion
- bat
- curl
- "{% if ansible_os_family == 'Debian' %}dnsutils{% else %}bind-tools{% endif %}"
2021-01-29 00:08:39 +00:00
- git
- man
- molly-guard
- needrestart
- "mtr{% if ansible_os_family == 'Debian' %}-tiny{% endif %}"
2021-01-29 00:08:39 +00:00
- sl
- htop
- patch
- sudo
2021-01-29 00:08:39 +00:00
- tmux
- traceroute
2021-01-29 00:08:39 +00:00
- tree
- unattended-upgrades
- vim
2021-01-29 00:08:39 +00:00
register: pkg_result
retries: 3
until: pkg_result is succeeded
- name: Create directory hierarchy
file:
path: '.config/{{ item }}'
state: directory
owner: '{{ user.name }}'
group: '{{ user.name }}'
mode: 0755
2021-01-29 00:08:39 +00:00
with_items:
- 'git/'
- 'bash/'
become_user: "{{ user.name }}"
2021-01-29 00:08:39 +00:00
- name: Deploying config files
template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
owner: '{{ user.name }}'
group: '{{ user.name }}'
mode: 0644
2021-01-29 00:08:39 +00:00
with_items:
- { src: bashrc.j2, dest: .bashrc }
- { src: inputrc.j2, dest: .inputrc }
- { src: bash_aliases.j2, dest: .config/bash/bash_aliases }
- { src: gitconfig.j2, dest: .config/git/config }
- { src: tmux.conf.j2, dest: .tmux.conf }
become_user: '{{ user.name }}'