summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-08-18 22:36:48 +0100
committerNick White <git@njw.name>2021-08-18 22:36:48 +0100
commit89cff0ecf987fa69edc52ee1c501b7073a303d0e (patch)
tree63c378326c1458addc816e20ee5ba2163c0af38d /roles
parent48020c6e284efe49de173d414842b916de9845a7 (diff)
Add rudpad ami rules
Diffstat (limited to 'roles')
-rw-r--r--roles/rudpad/tasks/main.yml82
-rw-r--r--roles/server/tasks/update.yml4
2 files changed, 86 insertions, 0 deletions
diff --git a/roles/rudpad/tasks/main.yml b/roles/rudpad/tasks/main.yml
new file mode 100644
index 0000000..eb26d81
--- /dev/null
+++ b/roles/rudpad/tasks/main.yml
@@ -0,0 +1,82 @@
+---
+
+- name: Update apt
+ apt:
+ update_cache: yes
+
+- name: Install packages
+ apt:
+ state: present
+ name:
+ - gcc
+ - git
+ - imagemagick
+ - libssl-dev # needed for getxbook
+ - make
+ - poppler-utils # for pdfimages
+
+- name: Download Go
+ get_url:
+ url: https://golang.org/dl/go1.17.linux-amd64.tar.gz
+ dest: /home/{{ ansible_user }}
+ become: no
+
+- name: Install Go
+ unarchive:
+ dest: /usr/local
+ src: /home/{{ ansible_user }}/go1.17.linux-amd64.tar.gz
+ remote_src: true
+
+- name: Add Go tool path to path
+ lineinfile:
+ path: /home/{{ ansible_user }}/.profile
+ line: PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
+
+- name: Get go repos
+ git:
+ dest: /home/{{ ansible_user }}/src/{{ item }}
+ repo: https://git.rescribe.xyz/{{ item }}
+ force: yes
+ become: no
+ with_items:
+ - bookpipeline
+ - preproc
+ - utils
+
+- name: Download necessary parts for rescribe building
+ command:
+ cmd: /usr/local/go/bin/go generate
+ chdir: /home/{{ ansible_user }}/src/bookpipeline/cmd/rescribe
+ become: no
+ environment:
+ PATH: /usr/local/go/bin
+
+- name: Get and build go repos
+ command:
+ cmd: /usr/local/go/bin/go install ./...
+ chdir: /home/{{ ansible_user }}/src/bookpipeline
+ become: no
+ with_items:
+ - bookpipeline
+ - preproc
+ - utils
+
+- name: Get getxbook
+ git:
+ dest: /home/{{ ansible_user }}/src/getxbook
+ repo: https://git.njw.name/getxbook.git
+ force: yes
+ become: no
+
+- name: Build getxbook
+ make:
+ chdir: /home/{{ ansible_user }}/src/getxbook
+ target: all
+ become: no
+
+- name: Install getxbook
+ make:
+ chdir: /home/{{ ansible_user }}/src/getxbook
+ target: install
+ params:
+ PREFIX: /home/{{ ansible_user }}/.local
diff --git a/roles/server/tasks/update.yml b/roles/server/tasks/update.yml
index 7a9b941..a5b0c84 100644
--- a/roles/server/tasks/update.yml
+++ b/roles/server/tasks/update.yml
@@ -1,5 +1,9 @@
---
# Updates the image
+- name: Update apt
+ apt:
+ update_cache: yes
+
- name: Update all packages
package: name=* state=latest force_apt_get=yes