56 lines
1.1 KiB
YAML
56 lines
1.1 KiB
YAML
---
|
|
- name: Install Essential Packages
|
|
hosts: all
|
|
become: yes
|
|
tasks:
|
|
|
|
- name: Install essential packages
|
|
apt:
|
|
name:
|
|
- vim
|
|
- git
|
|
- curl
|
|
- htop
|
|
- iftop
|
|
- dnsutils
|
|
- net-tools
|
|
- sudo
|
|
- wget
|
|
- unzip
|
|
- zip
|
|
- lsb-release
|
|
- gnupg
|
|
- gnupg2
|
|
- sysstat
|
|
- screen
|
|
- rsync
|
|
- tmux
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Configure Bash history with timestamps
|
|
hosts: all
|
|
become: yes
|
|
tasks:
|
|
- name: Add HISTTIMEFORMAT to .bashrc
|
|
lineinfile:
|
|
path: ~/.bashrc
|
|
regexp: '^export HISTTIMEFORMAT='
|
|
line: 'export HISTTIMEFORMAT="%F %T "'
|
|
state: present
|
|
|
|
- name: Source .bashrc to apply changes
|
|
shell: source ~/.bashrc
|
|
args:
|
|
executable: /bin/bash
|
|
|
|
- name: Display Bash history
|
|
shell: history
|
|
args:
|
|
executable: /bin/bash
|
|
register: history_output
|
|
|
|
- name: Print Bash history
|
|
debug:
|
|
msg: "{{ history_output.stdout }}"
|