diff --git a/roles/badges/backend/files/ps1test/setprodps1.sh b/roles/badges/backend/files/ps1test/setprodps1.sh new file mode 100644 index 0000000000..2ce137f184 --- /dev/null +++ b/roles/badges/backend/files/ps1test/setprodps1.sh @@ -0,0 +1,3 @@ +# Set PS1 based on env +# +PS1="\e[0;31m[PROD]\e[m[\u@\h \W]\$ " diff --git a/roles/badges/backend/files/ps1test/setstgps1.sh b/roles/badges/backend/files/ps1test/setstgps1.sh index ef5f7baf46..228c7d1384 100644 --- a/roles/badges/backend/files/ps1test/setstgps1.sh +++ b/roles/badges/backend/files/ps1test/setstgps1.sh @@ -1,4 +1,4 @@ # Set PS1 based on env # -PS1="[STG]\e[m[\u@\h \W]\$ " +PS1="[STG]\e[m[\u@\h \W]\$ " diff --git a/roles/badges/backend/tasks/main.yml b/roles/badges/backend/tasks/main.yml index 3d205e51f2..2a326848e1 100644 --- a/roles/badges/backend/tasks/main.yml +++ b/roles/badges/backend/tasks/main.yml @@ -168,7 +168,7 @@ - badges - badges/backend -#Set PS1 to show prod/stage environment at PS1 +#Set PS1 to show stage environment at PS1 #Should work in sh/bash. Needs tested in other shells # - name: set PS1 for stage in /etc/profile.d @@ -183,3 +183,18 @@ - base - config +#Set PS1 to show prod environment at PS1 +#Should work in sh/bash. Needs tested in other shells +# +- name: set PS1 for prod in /etc/profile.d + copy: > + src=ps1test/setprodps1.sh + dest="/etc/profile.d/setprodps1.sh" + owner=root + group=sysadmin-badges + mode=644 + when: env == 'production' + tags: + - base + - config +