hi
any idea how I can create multiple ec2 instances and tag it
main.yml
- include_vars: vars/main.yml
- name: create the ec2 instance
ec2:
assign_public_ip: no
group_id: '{{ deploy_env.sg_group }}'
instance_type: "{{ deploy_env.instance_type }}"
image: "{{ deploy_env.image }}"
wait: true
wait_timeout: 600
count: 10
region: "{{ deploy_env.region }}"
vpc_subnet_id: "{{ deploy_env.vpc_subnet_id}}"
private_ip: "{{ deploy_env.assign_ip }}"
instance_tags:
Name: "{{ deploy_env.instance_tags.name }}"
---------------------------
how do i put the names in my var file?
deploy_env:
instance_type: t2.micro
image: ami-02d03ce209db75523
sg_group:
- "sg-057771872265bfda6"
region: us-west-1
assign_ip: 10.10.1.10
vpc_subnet_id: subnet-0d9d37440a2265163
instance_tags:
name: test1
----------------
I need to apply ip address 10.10.1.11 - 10.10.1.20 and different tags to
the ec2 instances
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/7a17e070-baa9-4dae-9429-4dde024caa25n%40googlegroups.com.