-
Notifications
You must be signed in to change notification settings - Fork 0
/
ansible.yml
82 lines (82 loc) · 2.03 KB
/
ansible.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
- connection: localhost
environment:
PWD: /home/ubuntu
hosts: localhost
name: Bash converted playbook
remote_user: ubuntu
tasks:
- name: Set default working directory
set_fact:
cwd: /home/ubuntu
- local_action: shell ls ansible/
name: scp ansible/* ie-scraper:.ssh/
register: key_file
sudo: 'no'
- copy:
dest: '{{ cwd }}/.ssh//{{ item }}'
src: ansible/{{ item }}
with_items: '{{ key_file.stdout_lines }}'
- apt:
update_cache: 'yes'
name: apt-get update;
sudo: 'yes'
- apt:
upgrade: dist
name: apt-get dist-upgrade -y;
sudo: 'yes'
- apt:
name: '{{ item }}'
state: present
name: apt-get install -y python-pip chromium-browser chromium-chromedriver
sudo: 'yes'
with_items:
- python-pip
- chromium-browser
- chromium-chromedriver
- file:
path: /media/scraped
state: directory
name: mkdir /media/scraped
sudo: 'no'
- file:
dest: /media/scraped
group: ubuntu
owner: ubuntu
recurse: 'yes'
name: chown ubuntu:ubuntu /media/scraped
sudo: 'no'
- name: echo /dev/xvdp /media/scraped/ ext4 auto 0 1 >> /etc/fstab
shell: echo /dev/xvdp /media/scraped/ ext4 auto 0 1 >> /etc/fstab
sudo: 'no'
- mount:
path: /media/scraped
name: mount /media/scraped
sudo: 'no'
- file:
dest: /media/scraped
group: ubuntu
owner: ubuntu
recurse: 'yes'
name: chown -R ubuntu:ubuntu /media/scraped
sudo: 'no'
- name: git clone [email protected]:mgajda/scraper-python.git
shell: cd {{ cwd }} && git clone [email protected]:mgajda/scraper-python.git
sudo: 'no'
- name: cd scraper-python
set_fact:
cwd: '{{ cwd }}/scraper-python'
sudo: 'no'
- name: pip install -r requirements.txt
pip:
requirements: '{{ cwd }}/requirment.txt'
sudo: 'no'
- file:
path: '{{ item }}'
state: absent
name: rm -rf html logs output_csv
sudo: 'no'
with_items:
- '{{ cwd }}/html'
- '{{ cwd }}/logs'
- '{{ cwd }}/output_csv'