-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.yaml
60 lines (51 loc) · 1.42 KB
/
main.yaml
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
yum install python
yum install python-pip
# Basic provisioning example in EC2
- hosts: localhost
connection: local
become: False
gather_facts: False
tasks:
- pip:
name: boto
- name: Provision a set of instances
ec2:
aws_access_key:
aws_secret_key:
key_name: ajay1
instance_type: t2.micro
image: ami-15e9c770
region: us-east-2
wait: yes
group: default
count: 1
vpc_subnet_id: subnet-f6384f8d
assign_public_ip: yes
-------------------------------------------------------------End---------------------------------------------------------------
ansible-playbook -l webservers copy.yaml
---
# Basic provisioning example in EC2
- hosts: all
gather_facts: False
tasks:
- name: copy file to node2
shell:
cp -r {{ item.src }} {{ item.dest }}
with_items:
- { src: /etc/hosts, dest: /tmp/pappu.txt }
args:
creates: /tmp/pappu.txt
-----------------------------------------------------End----------------------------------------------------------------------
---
# copy file
- hosts: all
gather_facts: False
tasks:
- name: copy file to node2
shell:
cp -r {{ item.src }} {{ item.dest }}
with_items:
- { src: /etc/hosts, dest: /tmp/joe.txt }
- { src: /etc/hosts, dest: /tmp/zook.txt }
args:
creates: /var/lib/mysql/mysql.sock