-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpull_oled_setup_from_git.yml
More file actions
78 lines (64 loc) · 1.87 KB
/
pull_oled_setup_from_git.yml
File metadata and controls
78 lines (64 loc) · 1.87 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
67
68
69
70
71
72
73
74
75
76
77
---
-
hosts: all
become: true
become_method: sudo
become_user: root
tasks:
- name: install packages
apt:
name: "{{ item }}"
state: present
loop:
- libopenjp2-7-dev
- name: install python packages
pip:
name: "{{ item }}"
executable: pip3
loop:
- Pillow
- luma.oled
# actual command in the github
# sudo -H pip3 install --upgrade
# https://github.com/rm-hull/luma.oled
- name: Download fonts
get_url:
url: "{{ item.name }}"
dest: "{{ item.path }}"
mode: '0440'
loop:
- { name: 'https://www.1001fonts.com/download/font/monospace.medium.ttf', path: '/home/pi/oled/fonts' }
#- { name: 'https://github.com/rm-hull/luma.examples/blob/master/examples/demo_opts.py', path: '/home/pi/oled' }
- name: Create luma_examples directory
file:
state: directory
path: /home/pi/luma_examples
owner: pi
group: pi
mode: 0777
- name: Get gonet4 repo from GitHub
git:
dest: /home/pi/luma_examples
repo: "https://github.com/rm-hull/luma.examples.git"
update: yes
force: yes
version: "master"
- name: Copy demo_opts.py to oled directory from where previous block dumped it
copy:
src: /home/pi/luma_examples/examples/demo_opts.py
dest: /home/pi/oled/demo_opts.py
owner: pi
group: pi
mode: 0775
- name: Set I2C Port
blockinfile:
dest: "/etc/modules"
block: |
i2c-dev
i2c-bcm2708
- name: Set I2C Port part 2
blockinfile:
dest: "/boot/config.txt"
block: |
dtparam=i2c_arm=on
dtparam=i2c1=on