198 lines
5.8 KiB
YAML
198 lines
5.8 KiB
YAML
---
|
|
- name: create_ec2
|
|
hosts: localhost
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Create EC2 instances 1
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web1
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.151"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web1
|
|
|
|
- name: Create EC2 instances 2
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web2
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.152"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web2
|
|
|
|
- name: Create EC2 instances 3
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web3
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.153"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web3
|
|
|
|
- name: Create EC2 instances 4
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web4
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.154"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web4
|
|
|
|
- name: Create EC2 instances 5
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web5
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.155"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web5
|
|
|
|
- name: Create EC2 instances 6
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web6
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.156"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web6
|
|
|
|
- name: Create EC2 instances 7
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web7
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.157"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web7
|
|
|
|
- name: Create EC2 instances 8
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web8
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.158"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web8
|
|
|
|
- name: Create EC2 instances 9
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web9
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.159"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web9
|
|
|
|
- name: Create EC2 instances 10
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web10
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.160"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web10
|
|
|
|
- name: Create EC2 instances 11
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web11
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.161"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web11
|
|
|
|
- name: Create EC2 instances 12
|
|
amazon.aws.ec2_instance:
|
|
name: ansible_ec2_web12
|
|
instance_type: t2.micro
|
|
image_id: ami-0525a3bbe44c34cbf
|
|
key_name: hands-on_ansible
|
|
region: ap-northeast-1
|
|
vpc_subnet_id: subnet-0689f38f21f538a55
|
|
security_group: jenkins-ec2-sg
|
|
network:
|
|
assign_public_ip: yes
|
|
private_ip_address: "10.1.5.162"
|
|
device_index: 0
|
|
tags:
|
|
Name: ansible-ec2-web12
|