Skip to content

Commit

Permalink
improve the ansible vs iidy demo script
Browse files Browse the repository at this point in the history
  • Loading branch information
tavisrudd committed Aug 11, 2017
1 parent b34ffd2 commit d6027a2
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions examples/hello-world-ansible/demo-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ files:
DisplayName: !Sub "Hello ${Name}"
Foo: 1234
stack-args.yaml: |-
StackName: "{{ StackName }}" # auto generated name
Template: ./cfn-template.yaml
Profile: sandbox
Region: us-west-2
Parameters:
Name: world
Tags:
owner: your-name
project: iidy-demo
environment: development
lifetime: short
inventory/localhost: |-
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"
Expand Down Expand Up @@ -53,25 +69,29 @@ demo:
AWS_REGION: us-west-2
AWS_PROFILE: sandbox

- banner: "perform ansible's pre-flight check"
- ansible-playbook --check -i inventory/localhost create-stack.yml
- banner: create the stack
- banner: We're going to compare the developer experience of Ansible and iidy.
- sleep: 2
- banner: First, we create the stack with ansible.
- ansible-playbook -i inventory/localhost create-stack.yml
- silent: aws cloudformation describe-stacks --stack-name "{{ StackName }}" --query 'Stacks[0].StackId' --output text > stackid.txt

- banner: run a failing update
- banner: Then we run a broken update.
- mv broken-cfn-template.yaml cfn-template.yaml
- ansible-playbook -i inventory/localhost create-stack.yml || true
- silent: date
- banner: Note the unreadable failure message & the timestamp

- banner: |-
Note the unreadable failure message & the timestamp. When we run
`iidy describe-stack` we'll see that Ansible doesn't give us
feedback until after the rollback is complete. That could be a
very long time on a large stack.
Note the unreadable failure message & the timestamp.
Ansible gives us no feedback until after the rollback is
complete. That could be a *very long time* on a large stack.
- iidy describe-stack "$(cat stackid.txt)"
- sleep: 3
- banner: Let's try that again with iidy for comparison.
- sleep: 3
- iidy update-stack stack-args.yaml || true

- banner: "We'll use iidy to cleanup the stack"
- aws cloudformation delete-stack --stack-name "{{ StackName }}"
- sleep: 1
#- aws cloudformation delete-stack --stack-name "{{ StackName }}"
- iidy delete-stack --yes "{{ StackName }}"

0 comments on commit d6027a2

Please sign in to comment.