-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentware.yml
78 lines (64 loc) · 2.07 KB
/
entware.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
- hosts: all
gather_facts: False
vars:
- ansible_connection: ssh
- ansible_user: root
- ansible_python_interpreter: /home/root/.bin/python3
- ansible_ssh_pass: "{{ lookup('env','RM2_PASSWORD') }}"
tasks:
- name: check if already downloaded
stat:
path: /tmp/entware.zip
register: downloaded
- name: Download package
command:
chdir: /tmp
cmd: wget -O entware.zip http://github.com/Evidlo/remarkable_entware/archive/master.zip
- name: unzip package
shell:
cmd: unzip -o '/tmp/entware.zip' -d '/tmp/'
- name: Remove old install
file:
path: /home/root/.entware
state: absent
- name: Remove old install
file:
path: /opt/*
state: absent
- name: check if /opt is mounted
shell: df | grep opt | wc -l
register: opt
- name: Unmount /opt
shell:
cmd: umount /opt
when: opt.stdout == "1"
- name: Remove old install
file:
path: /opt
state: absent
- name: Install
shell:
chdir: /tmp/remarkable_entware-master
cmd: ./install.sh
- name: add to path
raw: grep -qF '/opt/bin' /etc/profile || (awk '/PATH="/{print;print "PATH=\"$PATH:\/opt\/bin\"";next}1' /etc/profile > /etc/profile.bak && mv /etc/profile.bak /etc/profile)
- name: Remove stable branch of toltec
lineinfile:
path: /opt/etc/opkg.conf
regexp: '^src/gz toltec https://toltec-dev.org/stable'
line: '# src/gz toltec https://toltec-dev.org/stable'
- name: Insert/Update "Match User" configuration block in /etc/ssh/sshd_config
blockinfile:
path: /opt/etc/opkg.conf
insertafter: EOF
block: |
arch rmall 200
arch rm2 250
src/gz toltec-rmall https://toltec-dev.org/testing/rmall
src/gz toltec-rm2 https://toltec-dev.org/testing/rm2
- name: Install sudo
shell:
cmd: /opt/bin/opkg install sudo
- name: Update sudoers
shell:
cmd: sed -i '/^#.*sudo.*ALL/s/^#//' /opt/etc/sudoers