simple_deploy icon indicating copy to clipboard operation
simple_deploy copied to clipboard

create with option --disable-rollback

Open munjeli opened this issue 11 years ago • 8 comments

I love simple_deploy but I don't see how to create a stack with that option; can I pass it somehow or is not supported? I need to ssh into my failures to see where the stack ran off the track.

munjeli avatar Sep 24 '14 20:09 munjeli

@munjeli

You can pass Abort-no to simple_deploy create.

simple_deploy create -e env -n stack_name -a Abort=no

Let us know if that solves your problem so we can close this.

Thanks.

ghost avatar Sep 24 '14 21:09 ghost

Alas, that didn't work. My stack is rolling back on failure.

munjeli avatar Sep 25 '14 00:09 munjeli

My bad. I forgot that we add abort support to our cloud formation templates to support that. When I am back at a laptop I can post a snippet for you if you want to try in your template.

Sent from my iPhone

On Sep 24, 2014, at 5:42 PM, Ele Munjeli <[email protected]mailto:[email protected]> wrote:

Alas, that didn't work. My instance is rolling back on failure.

Reply to this email directly or view it on GitHubhttps://github.com/intuit/simple_deploy/issues/241#issuecomment-56759756.

ghost avatar Sep 25 '14 01:09 ghost

@munjeli are you refering to the disable rollback option below:

DisableRollback
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Type: Boolean

Required: No

http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html

bw-intuit avatar Sep 25 '14 15:09 bw-intuit

Please do. For some reason I can't get it to work in the template even though I read the docs. A snippet would be helpful.

munjeli avatar Sep 25 '14 15:09 munjeli

@munjeli

Here we go. The hope is you can use this so we don't have to add an option to simple_deploy.

Snippet 1:

"Parameters": {
"Abort": {
      "Description": "Should the entire deployment be aborted if bootstrapping fails?",
      "Type": "String",
      "Default": "yes",
      "AllowedValues": [ "yes", "no" ],
      "ConstraintDescription": "yes or no"
    }
}

Snippet 2:

"Mappings": {
"BootstrapSettingMap": {
      "abort": { "yes": "$?", "no": "0" }
    }
}

Snippet 3:

"Resources": {
  "InstanceLaunchConfig": {
    "UserData": { "Fn::Base64": { "Fn::Join": ["", [
     "export CFN_SIGNAL_BIN=/path/to/cfn-signal", "\n",
     "runuser -c \"/path/to/myscript\" root", "\n",
      "export CONFIGURE_EXIT_STATUS=$? ",
            "CFN_ABORT_SIGNAL=", { "Fn::FindInMap": [ "BootstrapSettingMap", "abort", { "Ref": "Abort" } ] }, "\n",
       "if [ $CONFIGURE_EXIT_STATUS -ne 0 ] && [ $CFN_ABORT_SIGNAL -ne 0 ] ; ", "then", "\n",
         "$CFN_SIGNAL_BIN -e $CFN_ABORT_SIGNAL",
              " '", { "Ref": "InstancesWaitHandle" }, "'\n",
            "shutdown -h now", "\n",
        "else", "\n",
          "$CFN_SIGNAL_BIN -e $CFN_ABORT_SIGNAL",
              " '", { "Ref": "InstancesWaitHandle" }, "'\n",
          "fi", "\n",
       ]]}}

ghost avatar Sep 25 '14 16:09 ghost

Wow, no wonder I didn't figure it out :P

Thanks so much, I'll run these or mod my own. It shouldn't be you supporting the option, we should be able to access the option as a regular parameter in the template. It's a bit goofy to have it as a property of the stack but not being able to access it on the template.

Close the issue!

munjeli avatar Sep 25 '14 20:09 munjeli

@brettweavnet-intuit yes, the option on the cli where I can create a stack with --disable-rollback. Tragically, there isn't a way to insert "DisableRollback": True into the template.

munjeli avatar Sep 26 '14 01:09 munjeli