Skip to content

Commit

Permalink
Merge pull request #17 from eemperor/el6-fix
Browse files Browse the repository at this point in the history
Removed unnecessary EL7 commands and optimized CW agent download script
  • Loading branch information
eemperor authored Mar 29, 2018
2 parents cd5195b + d16ff36 commit 552a0e0
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.1.0
commit = True
message = Bumps version to {new_version}
tag = False
Expand Down
131 changes: 63 additions & 68 deletions modules/lx-autoscale/watchmaker-lx-autoscale.cfn.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
{
"Fn::If": [
"InstallCloudWatchAgent",
"install-cloudwatch-agent",
"cw-agent-install",
{
"Ref": "AWS::NoValue"
}
Expand Down Expand Up @@ -694,73 +694,14 @@
}
]
},
"finalize": {
"commands": {
"10-signal-success": {
"command": {
"Fn::Join": [
"",
[
"/opt/aws/bin/cfn-signal -e 0",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WatchmakerAutoScalingGroup",
{
"Fn::If": [
"AssignInstanceRole",
{
"Fn::Join": [
"",
[
" --role ",
{
"Ref": "InstanceRole"
}
]
]
},
""
]
},
{
"Fn::If": [
"UseCfnUrl",
{
"Fn::Join": [
"",
[
" --url ",
{
"Ref": "CfnEndpointUrl"
}
]
]
},
""
]
},
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
},
"ignoreErrors": "true"
}
}
},
"install-cloudwatch-agent": {
"cw-agent-install": {
"commands": {
"01-get-cloudwatch-agent": {
"command": {
"Fn::Join": [
"",
[
"mkdir -p /etc/cfn/scripts/ &&",
"install -Dbm 700 -o root -g root /dev/null /etc/cfn/scripts/AmazonCloudWatchAgent.zip &&",
" aws s3 cp ",
{
"Ref": "CloudWatchAgentUrl"
Expand All @@ -769,10 +710,7 @@
" --region ",
{
"Ref": "AWS::Region"
},
" &&",
" chown root:root /etc/cfn/scripts/AmazonCloudWatchAgent.zip &&",
" chmod 700 /etc/cfn/scripts/AmazonCloudWatchAgent.zip"
}
]
]
}
Expand All @@ -794,8 +732,6 @@
"",
[
" bash -xe install.sh &&",
" systemctl enable amazon-cloudwatch-agent.service &&",
" systemctl start amazon-cloudwatch-agent.service &&",
" /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl",
" -a fetch-config -m ec2 -c",
" file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s"
Expand Down Expand Up @@ -918,6 +854,65 @@
}
}
},
"finalize": {
"commands": {
"10-signal-success": {
"command": {
"Fn::Join": [
"",
[
"/opt/aws/bin/cfn-signal -e 0",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WatchmakerAutoScalingGroup",
{
"Fn::If": [
"AssignInstanceRole",
{
"Fn::Join": [
"",
[
" --role ",
{
"Ref": "InstanceRole"
}
]
]
},
""
]
},
{
"Fn::If": [
"UseCfnUrl",
{
"Fn::Join": [
"",
[
" --url ",
{
"Ref": "CfnEndpointUrl"
}
]
]
},
""
]
},
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
},
"ignoreErrors": "true"
}
}
},
"install-updates": {
"commands": {
"10-install-updates": {
Expand Down
131 changes: 63 additions & 68 deletions modules/lx-instance/watchmaker-lx-instance.cfn.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
{
"Fn::If": [
"InstallCloudWatchAgent",
"install-cloudwatch-agent",
"cw-agent-install",
{
"Ref": "AWS::NoValue"
}
Expand Down Expand Up @@ -640,73 +640,14 @@
}
]
},
"finalize": {
"commands": {
"10-signal-success": {
"command": {
"Fn::Join": [
"",
[
"/opt/aws/bin/cfn-signal -e 0",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WatchmakerInstance",
{
"Fn::If": [
"AssignInstanceRole",
{
"Fn::Join": [
"",
[
" --role ",
{
"Ref": "InstanceRole"
}
]
]
},
""
]
},
{
"Fn::If": [
"UseCfnUrl",
{
"Fn::Join": [
"",
[
" --url ",
{
"Ref": "CfnEndpointUrl"
}
]
]
},
""
]
},
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
},
"ignoreErrors": "true"
}
}
},
"install-cloudwatch-agent": {
"cw-agent-install": {
"commands": {
"01-get-cloudwatch-agent": {
"command": {
"Fn::Join": [
"",
[
"mkdir -p /etc/cfn/scripts/ &&",
"install -Dbm 700 -o root -g root /dev/null /etc/cfn/scripts/AmazonCloudWatchAgent.zip &&",
" aws s3 cp ",
{
"Ref": "CloudWatchAgentUrl"
Expand All @@ -715,10 +656,7 @@
" --region ",
{
"Ref": "AWS::Region"
},
" &&",
" chown root:root /etc/cfn/scripts/AmazonCloudWatchAgent.zip &&",
" chmod 700 /etc/cfn/scripts/AmazonCloudWatchAgent.zip"
}
]
]
}
Expand All @@ -740,8 +678,6 @@
"",
[
" bash -xe install.sh &&",
" systemctl enable amazon-cloudwatch-agent.service &&",
" systemctl start amazon-cloudwatch-agent.service &&",
" /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl",
" -a fetch-config -m ec2 -c",
" file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s"
Expand Down Expand Up @@ -864,6 +800,65 @@
}
}
},
"finalize": {
"commands": {
"10-signal-success": {
"command": {
"Fn::Join": [
"",
[
"/opt/aws/bin/cfn-signal -e 0",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WatchmakerInstance",
{
"Fn::If": [
"AssignInstanceRole",
{
"Fn::Join": [
"",
[
" --role ",
{
"Ref": "InstanceRole"
}
]
]
},
""
]
},
{
"Fn::If": [
"UseCfnUrl",
{
"Fn::Join": [
"",
[
" --url ",
{
"Ref": "CfnEndpointUrl"
}
]
]
},
""
]
},
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
},
"ignoreErrors": "true"
}
}
},
"install-updates": {
"commands": {
"10-install-updates": {
Expand Down

0 comments on commit 552a0e0

Please sign in to comment.