Wolfgang Kulhanek
2019-05-24 1f5dec526c1cf0cd2dda79a85cb82c7a65398c32
Updated Bastion to also set prompts
1 files added
2 files modified
64 ■■■■■ changed files
ansible/roles/bastion/files/bash_profile 2 ●●● patch | view | raw | blame | history
ansible/roles/bastion/files/bashrc 23 ●●●●● patch | view | raw | blame | history
ansible/roles/bastion/tasks/main.yml 39 ●●●●● patch | view | raw | blame | history
ansible/roles/bastion/files/bash_profile
@@ -8,4 +8,4 @@
# User specific environment and startup programs
export PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/local/maven/bin
export GUID=`hostname | awk -F. '{print $2}'`
export GUID=`hostname | awk -F. '{print $2}'`
ansible/roles/bastion/files/bashrc
New file
@@ -0,0 +1,23 @@
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls -F'
alias ll='ls -lF'
alias la='ls -aF'
# Source global definitions
if [ -f /etc/bashrc ]; then
  . /etc/bashrc
fi
# Set up Bash Git Prompt
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
  GIT_PROMPT_THEME=Evermeet
  GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=1
  GIT_PROMPT_ONLY_IN_REPO=0
  source "$HOME/.bash-git-prompt/gitprompt.sh"
fi
ansible/roles/bastion/tasks/main.yml
@@ -132,6 +132,45 @@
    owner: root
    group: root
- name: Install bash-git-prompt
  git:
    repo: https://github.com/magicmonty/bash-git-prompt.git
    dest: "{{ item }}/.bash-git-prompt"
    clone: yes
  loop:
  - "/root"
  - "/home/ec2-user"
  - "/etc/skel"
  tags:
  - install_bash_customization
- name: Change ownership of bash-git-prompt
  file:
    path: "{{ item.directory }}/.bash-git-prompt"
    owner: "{{ item.user }}"
    group: "{{ item.group }}"
    recurse: yes
  loop:
  - { directory: "/root",          user: "root",     group: "root" }
  - { directory: "/home/ec2-user", user: "ec2-user", group: "ec2-user" }
  - { directory: "/etc/skel",      user: "root",     group: "root" }
  tags:
  - install_bash_customization
- name: Install .bashrc
  copy:
    src: ../files/bashrc
    dest: "{{ item.directory }}/.bashrc"
    mode: 0644
    owner: "{{ item.user }}"
    group: "{{ item.group }}"
  loop:
  - { directory: "/root",          user: "root",     group: "root" }
  - { directory: "/home/ec2-user", user: "ec2-user", group: "ec2-user" }
  - { directory: "/etc/skel",      user: "root",     group: "root" }
  tags:
  - install_bash_customization
- name: Install .bash_profile
  copy:
    src: ../files/bash_profile