Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
bf7c51ad
Commit
bf7c51ad
authored
Apr 30, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding an ec2_elb test to re-add an instance that had been removed
parent
93fb82a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
test/integration/roles/test_ec2_elb/tasks/main.yml
+21
-19
No files found.
test/integration/roles/test_ec2_elb/tasks/main.yml
View file @
bf7c51ad
...
...
@@ -89,24 +89,6 @@
# ============================================================
# shutdown http first instance so it goes out of service
#- name: terminate first instance
# ec2:
# ec2_access_key: "{{ ec2_access_key }}"
# ec2_secret_key: "{{ ec2_secret_key }}"
# region: "{{ ec2_region }}"
# state: 'absent'
# instance_ids: "{{ ec2_provision_result.instance_ids[0] }}"
# register: result
#
#- name: assert the instance was terminated
# assert:
# that:
# - 'result.changed == True'
# - 'result.instance_ids[0] == ec2_provision_result.instance_ids[0]'
#
#- name: wait for the instance to die
# wait_for: port=80 host="{{ec2_provision_result.instances[0].public_ip}}" state=absent
-
name
:
"
shutdown
the
apache
service
on
the
first
instance
({{ec2_provision_result.instances[0].public_ip}})"
service
:
name=httpd state=stopped
remote_user
:
"
ec2-user"
...
...
@@ -163,6 +145,26 @@
-
'
"{{resource_prefix}}"
in
result.ansible_facts.ec2_elbs'
# ============================================================
# re-register the second instance (issue #4902)
-
name
:
re-register the second instance (issue
#4902)
ec2_elb
:
ec2_elbs
:
"
{{
resource_prefix
}}"
ec2_access_key
:
"
{{
ec2_access_key
}}"
ec2_secret_key
:
"
{{
ec2_secret_key
}}"
region
:
"
{{
ec2_region
}}"
instance_id
:
"
{{
ec2_provision_result.instance_ids[1]
}}"
state
:
present
wait_timeout
:
300
register
:
result
-
name
:
assert the instance was re-registered ok
assert
:
that
:
-
'
result.changed
==
True'
-
'
"{{resource_prefix}}"
in
result.ansible_facts.ec2_elbs'
# ============================================================
# remove all other instances
-
name
:
remove the rest of the instances
...
...
@@ -174,7 +176,7 @@
instance_id
:
"
{{
item
}}"
state
:
absent
wait_timeout
:
300
with_items
:
"
ec2_provision_result.instance_ids[
2
:]"
with_items
:
"
ec2_provision_result.instance_ids[
1
:]"
register
:
result
-
name
:
assert the other instances were removed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment