diff --git a/linux/pre-install.yml b/linux/pre-install.yml new file mode 100644 index 0000000..d3ae911 --- /dev/null +++ b/linux/pre-install.yml @@ -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 }}"