-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.yml
More file actions
60 lines (57 loc) · 1.69 KB
/
setup.yml
File metadata and controls
60 lines (57 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: "Creating 1 VM and some python libaries"
hosts: localhost
gather_facts: false
become: yes
#become_user: sudo
vars_files:
- vault.yml
tasks:
- name: "installing boto"
pip:
name: "boto"
executable: pip
- name: "installing boto3"
pip:
name: "boto3"
executable: pip3
- name: "creating security group"
ec2_group:
aws_access_key: "{{ ak }}"
aws_secret_key: "{{ sak }}"
name: 'launch-wizard-1'
description: 'sg with rule descriptions'
vpc_id: 'vpc-10db657a'
tags:
Name: "wordpress-sg"
region: "eu-central-1"
rules:
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 0.0.0.0/0
rule_desc: allow all on port 22 for ssh
- proto: tcp
cidr_ip: 0.0.0.0/0
ports:
- 80
rule_desc: allow all on port 80 for webserver
- proto: all
from_port: 0
to_port: 0
cidr_ip: 0.0.0.0/0
- name: "Creating Wordpress Instance"
ec2:
count: 1
image: "ami-00f654d297eee2abd"
instance_type: t2.micro
region: "eu-central-1"
wait: yes
instance_tags:
Name: wordpress
Created_by: Sunny
group: "launch-wizard-1"
key_name: "key123"
state: present
aws_access_key: "{{ ak }}"
aws_secret_key: "{{ sak }}"