Host *.example.com
ProxyCommand nc -x localhost:1080 %h %p
Host ec2
ServerAliveInterval 50
DynamicForward localhost:1090
User ec2-user
ProxyCommand nc -x localhost:1080 54.165.xx.yy 22
Host ip-10-0-1-*.ec2.internal
ProxyCommand nc -x localhost:1090 %h %p
User ubuntu
IdentityFile /home/me/.ssh/soc-proto-internal.pem
# bastion
Host ip-10-0-0-*.ec2.internal
ProxyCommand nc -x localhost:1090 %h %p
User ec2-user
IdentityFile /home/fortescu/.ssh/soc-proto-useast1.pem
dev # ssh ec2
Amazon Linux version 2015.03 is available.
[ec2-user@ip-10-0-0-188 ~]$
dev # ssh ip-10.0.1.32
Last login: Tue Jun 2 19:15:07 2015 from ip-10-0-0-188.ec2.internal
ubuntu@ip-10-0-1-32:~$
- name: Launch Opscenter instances
ec2:
key_name: "{{ key_name }}"
group_id: "{{ security_group }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
wait: true
region: "{{ region }}"
vpc_subnet_id: "{{ subnet_id }}"
assign_public_ip: no
ebs_optimized: no
instance_tags:
Name: "cassandra_opscenter"
dbtype: cassandra
register: ec2
- name: Logging
debug: msg="{{ item }}"
with_items: ec2.instances
- name: Add new instance to host group
add_host: hostname={{ item['private_dns_name'] }} ansible_ssh_host={{ item['private_dns_name'] }} groups=launched,opscenter_nodes
with_items: ec2.instances
- name: Wait for SSH to come up
local_action: wait_for port=22 host="{{ item['private_dns_name'] }}" search_regex=OpenSSH delay=10
with_items: ec2.instances
local_action: shell ssh "{{item['private_dns_name'] }}" echo hello
register: foo
retries: 5
delay: 5
until: foo.stdout.find('hello') != -1
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bef08c76-7742-49cb-816e-14dd1e5b1794%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.