forked from promogekko/python2-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yml
More file actions
66 lines (65 loc) · 2.21 KB
/
playbook.yml
File metadata and controls
66 lines (65 loc) · 2.21 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
61
62
63
64
65
66
---
- hosts: lunanode
become: true
remote_user: centos
become_method: sudo
become_user: root
vars_files:
- vars/main.yml
tasks:
- name: Install require packages
become: true
become_user: root
yum: name={{item}} state=present update_cache=yes
with_items:
- git
- wget
- yum-utils
- device-mapper-persistent-data
- lvm2
- name: Add docker repo
command: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- name: Add ce edge
command: yum-config-manager --enable docker-ce-edge
- name: Add ce test
command: yum-config-manager --enable docker-ce-test
- name: Add docker package
yum: name=docker-ce state=present update_cache=yes
- name: set docker daemon
command: systemctl enable docker
- name: start docker daemon
command: systemctl start docker
- name: set default user in docker group
command: usermod -aG docker centos
- name: Install epel
yum: name=epel-release state=present update_cache=yes
- name: install python pip
yum: name=python-pip state=present update_cache=yes
- name: Install docker compose
command: pip install docker-compose
- name: Install pyopenssl and other
command: pip install pyopenssl ndg-httpsclient pyasn1
- name: Update urllib3
command: pip install -U urllib3
- name: git clone
git: repo=https://github.com/promogekko/python2-aws.git dest=/home/centos/python2-aws update=yes
- name: do docker-compose
command: chdir=/home/centos/python2-aws docker-compose up -d
- include: tasks/main.yml
- name: Install python boto3
command: pip install boto3
- name: run copy logfiles to S3
become_user: centos
command: /home/centos/python2-aws/log2S3.py
- name: Copy the .netrc conf file
copy:
dest: "/home/centos/.netrc"
owner: centos
mode: 0600 # needed since it contains a password
content: |
machine db
login root
password password
- name: run backup database test to S3
become_user: centos
command: /home/centos/python2-aws/mysql-backup.py