Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
edx
configuration
Commits
1c583f26
Commit
1c583f26
authored
9 years ago
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes
parent
1cf310ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
8 deletions
+29
-8
playbooks/edx-east/edx_service.yml
+29
-8
No files found.
playbooks/edx-east/edx_service.yml
View file @
1c583f26
...
...
@@ -6,7 +6,6 @@
gather_facts
:
False
vars
:
state
:
"
present"
auto_scaling_service
:
True
tasks
:
-
name
:
Manage IAM Role and Profile
ec2_iam_role
:
...
...
@@ -233,6 +232,17 @@
tags
:
"
{{
asg_instance_tags
}}"
register
:
potential_existing_instances
-
name
:
Transform tags to the format ec2 module expects
util_map
:
function
:
zip_to_dict
input
:
"
{{
asg_instance_tags
}}"
args
:
[
'
key'
,
'
value'
]
register
:
reformatted_asg_instance_tags
#This task will create the number of instances requested (create_instances parameter).
# By default, it will create instances equaling the number of subnets specified.
#Modulo logic explained: The subnet specified will be the instance number modulo the number of subnets,
# so that instances are balanced across subnets.
-
name
:
Manage instances
ec2
:
profile
:
"
{{
profile
}}"
...
...
@@ -240,21 +250,22 @@
wait
:
"
yes"
group_id
:
"
{{
service_sec_group.group_id
}}"
key_name
:
"
{{
service_config.key_name
}}"
vpc_subnet_id
:
"
{{
created_service
.subnets.results[item|int
%
created_service.subnets.results|
length].subnet_id
}}"
vpc_subnet_id
:
"
{{
created_service
_subnets.results[item
|
int
%
created_service_subnets.results
|
length].subnet_id
}}"
instance_type
:
"
{{
service_config.instance_type
}}"
instance_tags
:
"
{{
asg_instance_tags
}}"
instance_tags
:
"
{{
reformatted_asg_instance_tags.function_output
}}"
image
:
"
{{
service_config.ami
}}"
instance_profile_name
:
"
{{
instance_profile_name
}}"
volumes
:
"
{{
service_config.volumes
}}"
with_sequence
:
count={{
create_instances|default(created_service.subnets.results|
length) }}
with_sequence
:
count={{
create_instances | default(created_service_subnets.results |
length) }}
when
:
not auto_scaling_service and potential_existing_instances.instances|length == 0
register
:
created_instances
-
name
:
Add new instances to host group
add_host
:
hostname
:
"
{{
item.1.p
ublic
_ip
}}"
groups
:
created_instances
hostname
:
"
{{
item.1.p
rivate
_ip
}}"
groups
:
created_instances
_group
#might need ansible_ssh_private_key_file and/or ansible_ssh_user
ansible_ssh_user
:
ubuntu
volumes
:
"
{{
service_config.volumes
}}"
with_subelements
:
-
created_instances.results
...
...
@@ -263,7 +274,7 @@
-
name
:
Configure launched instances
hosts
:
created_instances
hosts
:
created_instances
_group
gather_facts
:
False
become
:
True
tasks
:
...
...
@@ -275,6 +286,7 @@
host
:
"
{{
inventory_hostname
}}"
port
:
22
#Must wait for the instance to be ready before gathering facts
-
name
:
Gather facts
setup
:
...
...
@@ -289,7 +301,16 @@
-
ansible_mounts
-
volumes
-
name
:
Mount ephemeral disks
#Must use force=yes because AWS gives some ephemeral disks the wrong fstype and mounts them by default.
#Since we don't do this task if any prior instances were found in the ec2_lookup task, it's safe to force.
-
name
:
Create filesystems
filesystem
:
dev
:
"
{{
item.device_name
}}"
fstype
:
ext4
force
:
yes
with_items
:
volumes
-
name
:
Mount disks
mount
:
fstype
:
ext4
name
:
"
{{
item.mount
}}"
...
...
This diff is collapsed.
Click to expand it.
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