From 89cff0ecf987fa69edc52ee1c501b7073a303d0e Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 18 Aug 2021 22:36:48 +0100 Subject: Add rudpad ami rules --- roles/rudpad/tasks/main.yml | 82 +++++++++++++++++++++++++++++++++++++++++++ roles/server/tasks/update.yml | 4 +++ 2 files changed, 86 insertions(+) create mode 100644 roles/rudpad/tasks/main.yml (limited to 'roles') 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 -- cgit v1.2.1-24-ge1ad