Merge branch 'master' of /git/ansible
This commit is contained in:
commit
b240c5e58c
12 changed files with 29 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
vars:
|
||||
- keypair: buildsys
|
||||
- image: emi-B8793915
|
||||
- image: emi-68D638BF
|
||||
- instance_type: m1.large
|
||||
- security_group: builder
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.xlarge
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: webserver
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.small
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: twistedbot
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.large
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: webserver
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.small
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: webserver
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.small
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: webserver
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.large
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: jenkins
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: c1.xlarge
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: logstash
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
instance_type: m1.small
|
||||
image: emi-B8793915
|
||||
image: emi-68D638BF
|
||||
keypair: admin
|
||||
security_group: jenkins
|
||||
zone: fedoracloud
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
- ${private}/vars.yml
|
||||
|
||||
tasks:
|
||||
- include: $tasks/persistent_cloud.yml
|
||||
- include: $tasks/persistent_cloud_nodisks.yml
|
||||
|
||||
- name: provision instance
|
||||
hosts: twistedbots
|
||||
|
|
|
@ -22,4 +22,3 @@
|
|||
local_action: shell euca-attach-volume -i ${inst_res.instances[0].id} $item
|
||||
only_if: "'${host_is_up.rc}' != '0' and len('$item') != 0"
|
||||
with_items: $volumes
|
||||
|
||||
|
|
19
tasks/persistent_cloud_nodisks.yml
Normal file
19
tasks/persistent_cloud_nodisks.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
- name: check it out
|
||||
local_action: shell nc -d -z -w 5 ${inventory_hostname} 22 >>/dev/null
|
||||
register: host_is_up
|
||||
ignore_errors: true
|
||||
|
||||
- name: spin it up
|
||||
local_action: ec2_create keypair=${keypair} image=${image} type=${instance_type} wait=true group=${security_group}
|
||||
register: inst_res
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
||||
- name: assign it a special ip
|
||||
local_action: shell euca-associate-address -i ${inst_res.instances[0].id} ${public_ip}
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
||||
- name: wait for the reassignation
|
||||
local_action: wait_for host=${public_ip} port=22 delay=20 timeout=300
|
||||
only_if: "'${host_is_up.rc}' != '0'"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue