conditionally deploy dd role in prod

This commit is contained in:
Aaron Meihm 2017-02-09 12:31:02 -06:00
Родитель 583169387c
Коммит b516699264
2 изменённых файлов: 34 добавлений и 4 удалений

Просмотреть файл

@ -59,6 +59,9 @@
"Description": "S3 URL for sops data"
}
},
"Conditions": {
"IsProd": { "Fn::Equals": [ { "Ref": "Environment"}, "prod" ] }
},
"Resources": {
"InstanceProfile": {
"Type": "AWS::IAM::InstanceProfile",
@ -98,7 +101,13 @@
{ "Fn::ImportValue": { "Fn::Sub": "${RDSStack}-DBInstanceAddress" }},
"' >> vars/cfoutput.yml\n",
"/root/go/bin/sops -d -i vars/sec.yml\n",
"ansible-playbook -t users,api,td-agent,datadog entry.yml\n"
"ansible-playbook -t users,api,td-agent"
{ "Fn::If": [
"IsProd",
",datadog",
""
] },
" entry.yml\n"
]
]
}
@ -202,7 +211,13 @@
{ "Fn::ImportValue": { "Fn::Sub": "${RDSStack}-DBInstanceAddress" }},
"' >> vars/cfoutput.yml\n",
"/root/go/bin/sops -d -i vars/sec.yml\n",
"ansible-playbook -t users,scheduler,td-agent,datadog entry.yml\n"
"ansible-playbook -t users,scheduler,td-agent"
{ "Fn::If": [
"IsProd",
",datadog",
""
] },
" entry.yml\n"
]
]
}
@ -246,7 +261,13 @@
{ "Fn::GetAtt": [ "Relay2", "PrivateDnsName" ] },
"' >> vars/cfoutput.yml\n",
"/root/go/bin/sops -d -i vars/sec.yml\n",
"ansible-playbook -t users,relay1,td-agent,datadog entry.yml\n"
"ansible-playbook -t users,relay1,td-agent"
{ "Fn::If": [
"IsProd",
",datadog",
""
] },
" entry.yml\n"
]
]
}
@ -293,7 +314,13 @@
".yml vars/sec.yml\n",
"echo '---' > vars/cfoutput.yml\n",
"/root/go/bin/sops -d -i vars/sec.yml\n",
"ansible-playbook -t users,relay2,td-agent,datadog entry.yml\n",
"ansible-playbook -t users,relay2,td-agent",
{ "Fn::If": [
"IsProd",
",datadog",
""
] },
" entry.yml\n",
"cfn-signal -e 0 --stack '",
{ "Ref": "AWS::StackName" },
"' --resource 'Relay2' --region '",

Просмотреть файл

@ -37,6 +37,9 @@
"Description": "S3 URL for sops data"
}
},
"Conditions": {
"IsProd": { "Fn::Equals": [ { "Ref": "Environment"}, "prod" ] }
},
"Resources": {
"VPC": {
"Type": "AWS::EC2::VPC",