From 10384761f1fb4c08dde46333bc35ff107cb6800b Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Tue, 14 Mar 2017 14:53:34 -0700 Subject: [PATCH] fix branding, route cron mail, add msca shim --- management-d0dev.yml | 1 + roles/common/files/31-branding | 2 +- roles/management/templates/sqs-poll.cron.j2 | 3 +++ roles/msca/files/msca.sh | 12 ++++++++++++ roles/msca/tasks/main.yml | 8 ++++++++ vpcaccess-d0dev.yml | 1 + 6 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 roles/msca/files/msca.sh create mode 100644 roles/msca/tasks/main.yml diff --git a/management-d0dev.yml b/management-d0dev.yml index a1e1dc0..c73399a 100644 --- a/management-d0dev.yml +++ b/management-d0dev.yml @@ -3,4 +3,5 @@ become: true roles: - common + - msca - management diff --git a/roles/common/files/31-branding b/roles/common/files/31-branding index cc18720..97e3d5c 100644 --- a/roles/common/files/31-branding +++ b/roles/common/files/31-branding @@ -1,5 +1,5 @@ #!/bin/sh source /etc/profile figlet -f small ' AWSible' -echo "This is a ${CLOUD_MODULE} system in the ${CLOUD_ACCOUNT} environment." +echo "This is a ${CLOUD_CLUSTER} system in the ${CLOUD_ENVIRONMENT} environment." echo diff --git a/roles/management/templates/sqs-poll.cron.j2 b/roles/management/templates/sqs-poll.cron.j2 index 872c7ba..9adc22b 100644 --- a/roles/management/templates/sqs-poll.cron.j2 +++ b/roles/management/templates/sqs-poll.cron.j2 @@ -1 +1,4 @@ +{% if MANAGEMENT_EMAIL is defined %} +MAILTO={{ MANAGEMENT_EMAIL }} +{% endif %} * * * * * ec2-user {{ MANAGEMENT_DATA_ROOT }}/sqs-action.py {{ MANAGEMENT_DATA_ROOT }} {{ MANAGEMENT_EVENT_QUEUE }} {{ management_notice_topic.sns_arn }} diff --git a/roles/msca/files/msca.sh b/roles/msca/files/msca.sh new file mode 100755 index 0000000..674730b --- /dev/null +++ b/roles/msca/files/msca.sh @@ -0,0 +1,12 @@ +# configure environment for MSCA AWS things + +# as of pip2.7, all pip installed binaries are here +# pathmunge /usr/local/bin + +## Add user-data to environment. Because we use asgard this should be safe... +## came from http://stackoverflow.com/questions/10520605/bashs-source-command-not-working-with-a-file-curld-from-internet +## NOTE, if you create your own init script you must copy the below to /etc/default/myScriptName +source /dev/stdin <<< "$(curl -s --fail http://169.254.169.254/latest/user-data)" + +# set 'screen' title +echo -n -e "\033k$INSTANCE_ID-$CLOUD_CLUSTER\033\\" diff --git a/roles/msca/tasks/main.yml b/roles/msca/tasks/main.yml new file mode 100644 index 0000000..cd3c7e4 --- /dev/null +++ b/roles/msca/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: install cloud env var thingy + copy: + dest: /etc/profile.d/msca.sh + src: msca.sh + mode: "0644" + owner: root + group: root diff --git a/vpcaccess-d0dev.yml b/vpcaccess-d0dev.yml index f11242e..b6f1007 100644 --- a/vpcaccess-d0dev.yml +++ b/vpcaccess-d0dev.yml @@ -3,4 +3,5 @@ become: true roles: - common + - msca - vpcaccess -- 2.45.2