2020-02-11 21:42:56 +00:00
# 1. INSTALL 3 PREREQS
2020-01-30 09:00:00 +00:00
- name : "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
set_fact :
nodejs_install : True
nodejs_enabled : True
2020-02-04 23:19:44 +00:00
- name : NODEJS - run 'nodejs' role (attempt to install & enable Node.js)
2019-10-15 09:51:59 +00:00
include_role :
name : nodejs
2021-06-17 09:10:09 +00:00
- name : Assert that 10.x <= nodejs_version ({{ nodejs_version }}) <= 16.x
assert :
that : nodejs_version is version('10.x', '>=') and nodejs_version is version('16.x', '<=')
fail_msg : "Internet Archive install cannot proceed, as it currently requires Node.js 10.x - 16.x, and your nodejs_version is set to {{ nodejs_version }}. Please check the value of nodejs_version in /opt/iiab/iiab/vars/default_vars.yml and possibly also /etc/iiab/local_vars.yml"
quiet : yes
2020-02-04 23:19:44 +00:00
2020-01-30 09:00:00 +00:00
- name : "Set 'yarn_install: True' and 'yarn_enabled: True'"
set_fact :
yarn_install : True
yarn_enabled : True
2020-02-04 23:19:44 +00:00
- name : YARN - run 'yarn' role (attempt to install & enable Yarn package manager)
2019-10-15 09:51:59 +00:00
include_role :
name : yarn
2020-01-30 09:00:00 +00:00
- name : Install package 'libsecret-1-dev'
2019-10-15 09:51:59 +00:00
package :
2020-01-30 09:00:00 +00:00
name : libsecret-1-dev
2019-10-15 09:51:59 +00:00
state : present
2020-02-04 23:19:44 +00:00
2020-02-11 21:42:56 +00:00
# 2. CREATE 2 DIRS, WIPE /opt/iiab/internetarchive/node_modules & RUN YARN
2020-01-30 09:00:00 +00:00
- name : mkdir {{ internetarchive_dir }}
2019-10-15 09:51:59 +00:00
file :
state : directory
2020-02-04 23:19:44 +00:00
path : "{{ internetarchive_dir }}" # /opt/iiab/internetarchive
2019-10-15 09:51:59 +00:00
2020-02-11 21:42:56 +00:00
- name : Wipe dir {{ internetarchive_dir }}/node_modules (and its contents, typically 112+ MB) so './runrole --reinstall internetarchive' gets you the latest code
file :
state : absent
path : "{{ internetarchive_dir }}/node_modules"
2020-02-12 09:02:50 +00:00
- name : Run 'yarn add @internetarchive/dweb-mirror' to download/populate {{ internetarchive_dir }}/node_modules (CAN TAKE ~5 MINUTES)
2019-10-15 09:51:59 +00:00
shell : yarn config set child-concurrency 1 && yarn add @internetarchive/dweb-mirror
args :
chdir : "{{ internetarchive_dir }}"
creates : "{{ internetarchive_dir }}/node_modules/@internetarchive/dweb-mirror/internetarchive"
2020-02-04 23:19:44 +00:00
- name : mkdir {{ content_base }}/archiveorg
2019-10-15 09:51:59 +00:00
file :
state : directory
2020-02-04 23:19:44 +00:00
path : "{{ content_base }}/archiveorg" # /library
2019-10-15 09:51:59 +00:00
2020-02-11 21:42:56 +00:00
# 3. CONFIG FILES
2019-10-15 09:51:59 +00:00
2020-05-20 23:38:09 +00:00
- name : "Install from template: /etc/systemd/system/internetarchive.service"
2019-10-15 09:51:59 +00:00
template :
2020-05-20 23:38:09 +00:00
src : internetarchive.service.j2
dest : /etc/systemd/system/internetarchive.service
2020-01-30 09:00:00 +00:00
2020-02-11 21:42:56 +00:00
# 4. RECORD Internet Archive AS INSTALLED
2020-01-30 09:00:00 +00:00
- name : "Set 'internetarchive_installed: True'"
set_fact :
internetarchive_installed : True
2020-01-12 23:15:33 +00:00
- name : "Add 'internetarchive_installed: True' to {{ iiab_state_file }}"
2019-10-15 09:51:59 +00:00
lineinfile :
2020-02-04 20:03:59 +00:00
path : "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
2019-10-15 09:51:59 +00:00
regexp : '^internetarchive_installed'
line: 'internetarchive_installed : True '