Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Mohamed Alibi
ansible-examples
Commits
e5a3c162
Commit
e5a3c162
authored
Jul 28, 2016
by
Dave Johnson
Browse files
Added provisioning playbook for AWS
Added a playbook to provision instances for demo specific to AWS.
parent
ffcb873e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
0 deletions
+95
-0
lamp_haproxy/aws/demo-aws-launch.yml
lamp_haproxy/aws/demo-aws-launch.yml
+76
-0
lamp_haproxy/aws/group_vars/all
lamp_haproxy/aws/group_vars/all
+19
-0
No files found.
lamp_haproxy/aws/demo-aws-launch.yml
0 → 100644
View file @
e5a3c162
---
# Provision instances in AWS specific to the LAMP HA Proxy demo
-
name
:
Provision instances in AWS
hosts
:
localhost
connection
:
local
gather_facts
:
False
# load AWS variables from this group vars file
vars_files
:
-
group_vars/all
tasks
:
-
name
:
Launch webserver instances
ec2
:
access_key
:
"
{{
ec2_access_key
}}"
secret_key
:
"
{{
ec2_secret_key
}}"
keypair
:
"
{{
ec2_keypair
}}"
group
:
"
{{
ec2_security_group
}}"
type
:
"
{{
ec2_instance_type
}}"
image
:
"
{{
ec2_image
}}"
region
:
"
{{
ec2_region
}}"
instance_tags
:
"
{'ansible_group':'{{
ec2_tag_webservers
}}',
'type':'{{
ec2_instance_type
}}',
'group':'{{
ec2_security_group
}}',
'Name':'demo_''{{
tower_user_name
}}'}"
count
:
"
{{
ec2_instance_count
}}"
wait
:
true
register
:
ec2
-
name
:
Launch database instance
ec2
:
access_key
:
"
{{
ec2_access_key
}}"
secret_key
:
"
{{
ec2_secret_key
}}"
keypair
:
"
{{
ec2_keypair
}}"
group
:
"
{{
ec2_security_group
}}"
type
:
"
{{
ec2_instance_type
}}"
image
:
"
{{
ec2_image
}}"
region
:
"
{{
ec2_region
}}"
instance_tags
:
"
{'ansible_group':'{{
ec2_tag_dbservers
}}',
'type':'{{
ec2_instance_type
}}',
'group':'{{
ec2_security_group
}}',
'Name':'demo_''{{
tower_user_name
}}'}"
count
:
"
1"
wait=true
register
:
ec2
-
name
:
Launch load balancing instance
ec2
:
access_key
:
"
{{
ec2_access_key
}}"
secret_key
:
"
{{
ec2_secret_key
}}"
keypair
:
"
{{
ec2_keypair
}}"
group
:
"
{{
ec2_security_group
}}"
type
:
"
{{
ec2_instance_type
}}"
image
:
"
{{
ec2_image
}}"
region
:
"
{{
ec2_region
}}"
instance_tags
:
"
{'ansible_group':'{{
ec2_tag_lbservers
}}',
'type':'{{
ec2_instance_type
}}',
'group':'{{
ec2_security_group
}}',
'Name':'demo_''{{
tower_user_name
}}'}"
count
:
"
1"
wait
:
true
register
:
ec2
-
name
:
Launch monitoring instance
ec2
:
access_key
:
"
{{
ec2_access_key
}}"
secret_key
:
"
{{
ec2_secret_key
}}"
keypair
:
"
{{
ec2_keypair
}}"
group
:
"
{{
ec2_security_group
}}"
type
:
"
{{
ec2_instance_type
}}"
image
:
"
{{
ec2_image
}}"
region
:
"
{{
ec2_region
}}"
instance_tags
:
"
{'ansible_group':'{{
ec2_tag_monitoring
}}',
'type':'{{
ec2_instance_type
}}',
'group':'{{
ec2_security_group
}}',
'Name':'demo_''{{
tower_user_name
}}'}"
count
:
"
1"
wait
:
true
register
:
ec2
-
name
:
Wait for SSH to come up
wait_for
:
host
:
{{
item.public_dns_name
}}
port
:
22
delay
:
60
timeout
:
320
state
:
started
with_items
:
ec2.instances
lamp_haproxy/aws/group_vars/all
View file @
e5a3c162
...
@@ -3,3 +3,22 @@
...
@@ -3,3 +3,22 @@
httpd_port: 80
httpd_port: 80
ntpserver: 192.168.1.2
ntpserver: 192.168.1.2
# AWS specific variables
ec2_access_key:
ec2_secret_key:
ec2_region: us-east-1
ec2_zone:
ec2_image: ami-bc8131d4
ec2_instance_type: m1.small
ec2_keypair: djohnson
ec2_security_group: default
ec2_instance_count: 3
ec2_tag: demo
ec2_tag_webservers: webservers
ec2_tag_dbservers: dbservers
ec2_tag_lbservers: lbservers
ec2_tag_monitoring: monitoring
ec2_tag_name_prefix: dj
ec2_hosts: all
wait_for_port: 22
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