From 5b1a13c087b976c7a6c462eea05d148402286d0f Mon Sep 17 00:00:00 2001 From: Alex Tavarez Date: Fri, 5 Sep 2025 18:47:52 -0400 Subject: [PATCH] Renamed playbook --- playbooks/{admin_login.yml => init_login.yml} | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) rename playbooks/{admin_login.yml => init_login.yml} (51%) diff --git a/playbooks/admin_login.yml b/playbooks/init_login.yml similarity index 51% rename from playbooks/admin_login.yml rename to playbooks/init_login.yml index 784b32b..3afe3d7 100644 --- a/playbooks/admin_login.yml +++ b/playbooks/init_login.yml @@ -1,5 +1,5 @@ --- -- name: admin_login +- name: init_login hosts: servers # @NOTE for IPv6, switch to 'servers6' instead of 'servers4'--for both, 'servers' vars_files: # @NOTE if second line is uncommented with its variables actively in use, first line should too be uncommented @@ -24,4 +24,49 @@ handlers_from: main tasks_from: deshell apply: - become: yes \ No newline at end of file + become: yes + - name: Create global bash aliases + become: yes + ansible.builtin.copy: + src: files/all/bash/bash_aliases + dest: "/etc/bash_aliases" + owner: root + group: root + follow: yes + force: yes + backup: yes + mode: "0644" + state: present + - name: Create global bash functions + become: yes + ansible.builtin.copy: + src: files/all/bash/bash_functions + dest: "/etc/bash_functions" + owner: root + group: root + follow: yes + force: yes + backup: yes + mode: "0644" + state: present + - name: Register bash aliases and functions to global bashrc + become: yes + ansible.builtin.blockinfile: + block: | + if [ -f /etc/bash_aliases ]; then + . /etc/bash_aliases + fi + + if [ -f /etc/bash_functions ]; then + . /etc/bash_functions + fi + path: "/etc/bash.bashrc" + prepend_newline: yes + marker: "# {mark} ANSIBLE MANAGED SYSTEM-WIDE BASH ALIASES AND FUNCTIONS BLOCK" + insertafter: EOF + create: yes + owner: root + group: root + backup: yes + state: present + \ No newline at end of file