testing a change to PS1
This commit is contained in:
parent
9b5b631745
commit
f5cbec16e6
2 changed files with 24 additions and 0 deletions
|
@ -167,3 +167,19 @@
|
||||||
- scripts
|
- scripts
|
||||||
- badges
|
- badges
|
||||||
- badges/backend
|
- badges/backend
|
||||||
|
|
||||||
|
#Set PS1 to show prod/stage environment at PS1
|
||||||
|
#Should work in sh/bash. Needs tested in other shells
|
||||||
|
#
|
||||||
|
- name: set PS1 for prod and stage in /etc/profile.d
|
||||||
|
copy: >
|
||||||
|
src=templates/setps1.sh.j2
|
||||||
|
dest=/etc/profile.d/setps1.sh
|
||||||
|
owner=root
|
||||||
|
group=sysadmin-badges
|
||||||
|
mode=644
|
||||||
|
when: {{ env in ['production','staging'] }}
|
||||||
|
tags:
|
||||||
|
- base
|
||||||
|
- config
|
||||||
|
|
||||||
|
|
8
roles/badges/backend/templates/setps1.sh.j2
Normal file
8
roles/badges/backend/templates/setps1.sh.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Set PS1 based on env:
|
||||||
|
#
|
||||||
|
{% if {{ env }} in 'production' %}
|
||||||
|
PS1="\e[0;31m[PROD]\e[m[\u@\h \W]\$ "
|
||||||
|
{% elif {{ env }} in 'staging' %}
|
||||||
|
PS1="[STG]\e[m[\u@\h \W]\$ "
|
||||||
|
{% endif }%
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue