add pre-install playbook
This commit is contained in:
54
linux/pre-install.yml
Normal file
54
linux/pre-install.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
|
- 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 }}"
|
||||||
Reference in New Issue
Block a user