From 0dcf06601e9d304ff99a051fd97ec5e06724480d Mon Sep 17 00:00:00 2001 From: aikidouke Date: Mon, 11 Apr 2016 13:42:29 +0000 Subject: [PATCH] set prod/stg colored PS1 depending on env == staging or production remove from testing on badges and added to base role --- roles/badges/backend/tasks/main.yml | 29 ------------------ .../ps1test => base/files}/setprodps1.sh | 0 .../files/ps1test => base/files}/setstgps1.sh | 0 roles/base/tasks/main.yml | 30 +++++++++++++++++++ 4 files changed, 30 insertions(+), 29 deletions(-) rename roles/{badges/backend/files/ps1test => base/files}/setprodps1.sh (100%) rename roles/{badges/backend/files/ps1test => base/files}/setstgps1.sh (100%) diff --git a/roles/badges/backend/tasks/main.yml b/roles/badges/backend/tasks/main.yml index 2a326848e1..6455b64d16 100644 --- a/roles/badges/backend/tasks/main.yml +++ b/roles/badges/backend/tasks/main.yml @@ -168,33 +168,4 @@ - badges - badges/backend -#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 - copy: > - src=ps1test/setstgps1.sh - dest="/etc/profile.d/setstgps1.sh" - owner=root - group=sysadmin-badges - mode=644 - when: env == 'staging' - tags: - - 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 diff --git a/roles/badges/backend/files/ps1test/setprodps1.sh b/roles/base/files/setprodps1.sh similarity index 100% rename from roles/badges/backend/files/ps1test/setprodps1.sh rename to roles/base/files/setprodps1.sh diff --git a/roles/badges/backend/files/ps1test/setstgps1.sh b/roles/base/files/setstgps1.sh similarity index 100% rename from roles/badges/backend/files/ps1test/setstgps1.sh rename to roles/base/files/setstgps1.sh diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 5ddb308c49..44257a37c0 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -363,3 +363,33 @@ # - name: Set up watchdog include: watchdog.yml + + +#Set PS1 to show stage environment at PS1 +# +- name: set PS1 for stage in /etc/profile.d + copy: > + src=setstgps1.sh + dest="/etc/profile.d/setstgps1.sh" + owner=root + group=root + mode=644 + when: env == 'staging' + tags: + - base + - config + +#Set PS1 to show prod environment at PS1 +# +- name: set PS1 for prod in /etc/profile.d + copy: > + src=setprodps1.sh + dest="/etc/profile.d/setprodps1.sh" + owner=root + group=root + mode=644 + when: env == 'production' + tags: + - base + - config +