Skip to content

Commit 75f51fb

Browse files
authored
Improve ~remote~ _playbook_ instructions. (#2191)
* Improve remote instructions. * Add new variable to remote playbook intructions. * Leave the cantaloupe_HttpResolver_BasicLookupStrategy_url_prefix='' to allow cantaloupe. * Instructions for Playbook in Two Pieces. * Update Ubuntu version mentioned to 22.04. * Make more consistent. * Mention how to recreate VM. * Remove accidental files.
1 parent 218fdfa commit 75f51fb

File tree

1 file changed

+73
-111
lines changed

1 file changed

+73
-111
lines changed

docs/installation/playbook.md

Lines changed: 73 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
# Islandora Playbook
22

3-
!!! note "Still Alive"
4-
Reports of the playbook's demise have been exaggerated. It is still in use and being maintained. Local VMs (VirtualBox) cannot be run on M1 series Apple silicon at this time, but you can use the remote deployment option to deploy Islandora on low-cost virtual hosting.
3+
The Islandora Playbook ([Islandora-Devops/islandora-playbook](https://github.com/Islandora-Devops/islandora-playbook)) is a tool for installing the Islandora stack on a single virtual machine. It can be used both as a [Vagrant](https://www.vagrantup.com/) project to create a local development environment, or as an [Ansible](https://www.ansible.com/community) playbook to provision a local or remote server. It can set up a Drupal based either on Islandora Starter Site, or on the Install Profile Demo.
54

6-
The Islandora Playbook ([Islandora-Devops/islandora-playbook](https://github.com/Islandora-Devops/islandora-playbook)) is a tool for installing the Islandora stack on a single virtual machine. It can be used both as a [Vagrant](https://www.vagrantup.com/) project to create a local development environment, or as an [Ansible](https://www.ansible.com/community) playbook to provision a local or remote server. It can set up a Drupal based either on Islandora Starter Site, or on the Install Profile Demo.
5+
## Basic Usage (Vagrant):
76

8-
## Basic Usage (local, Islandora Starter Site):
9-
10-
Install requirements, then:
7+
Install requirements (below), then:
118
```bash
129
$ git clone -b dev https://github.com/Islandora-Devops/islandora-playbook
1310
$ cd islandora-playbook
14-
$ vagrant up
1511
```
16-
## Basic Usage (local, Install Profile Demo):
17-
18-
Install requirements, then:
12+
First, create the islandora base box:
13+
```bash
14+
$ ISLANDORA_BUILD_BASE=true vagrant up
15+
$ vagrant package --output islandora_base
16+
$ vagrant destroy
17+
```
18+
Second, build a VM using the islandora base box:
1919
```bash
20-
$ git clone -b dev https://github.com/Islandora-Devops/islandora-playbook
21-
$ cd islandora-playbook
22-
$ export ISLANDORA_INSTALL_PROFILE=demo
2320
$ vagrant up
2421
```
2522

26-
## Requirements
23+
When used this way, you can trash your working site and get a fresh Islandora relatively quickly, with `vagrant destroy` (you will be asked to confirm, as this will delete all your changes and your content), and then `vagrant up`.
24+
25+
## Requirements (Vagrant)
2726

2827
To create a local VM, download and install the following.
2928

@@ -34,7 +33,7 @@ To create a local VM, download and install the following.
3433
5. [Ansible](https://www.ansible.com/community) (Tested on version 2.11+, versions back to 2.9 should work.)
3534

3635

37-
#### Installing Git and Ansible on MacOS
36+
### Installing Git and Ansible on MacOS
3837

3938
OpenSSL is already pre-installed on MacOS. Git can be installed using XCode's command line tools (see below). Python and Pip can either be installed via the downloaded installer direct from the site or via Homebrew (not shown below). Ansible is best installed using [Homebrew](https://brew.sh/) (see below).
4039

@@ -49,7 +48,9 @@ $ brew install ansible
4948

5049
## Installing a local development environment
5150

52-
Clone the `islandora-playbook` and use `vagrant up` to automatically provision a local environment. This method uses Vagrant, VirtualBox, and Ansible. Before provisioning a local environment, you should likely double check that no [required ports](#port-clashes-for-local-environments) are currently in use.
51+
You will use `vagrant up` twice, first to create an Islandora base box, and then again to provision that base box into a full Islanodra. This method uses Vagrant, VirtualBox, and Ansible.
52+
53+
!!! warn Make sure that no [required ports](#port-clashes-for-local-environments) are currently in use.
5354

5455
### Clone the playbook
5556

@@ -58,33 +59,60 @@ $ git clone -b dev https://github.com/Islandora-Devops/islandora-playbook
5859
$ cd islandora-playbook
5960
```
6061

61-
### Spin up with Vagrant
62+
### Create the Base Box
6263

63-
Before using `vagrant up`:
64+
The Playbook will create a "base box" that includes core software (PHP, Apache, etc). Since these do not need to be updated too often, this can be packaged as a Vagrant base box that will be used to quickly provision the Islandora part.
6465

66+
Notes:
6567
- If building a CentOS box, you also need to install the vbguest additions with `vagrant plugin install vagrant-vbguest`.
66-
- If this is not your first time spinning up Islandora from this directory, and you want to get the latest code, you may want to clear cached ansible roles in roles/external `rm -rf roles/external`
68+
- If this is not your first time spinning up the Islandora Playbook from this directory, you may want to clear cached ansible roles in roles/external" `rm -rf roles/external`
69+
70+
First, create the islandora base box by overriding the Vagrant variable `ISLANDORA_BUILD_BASE` (which defaults to `false` in the `Vagrantfile`):
71+
```bash
72+
$ ISLANDORA_BUILD_BASE=true vagrant up
73+
```
6774

68-
Then, to spin up the machine:
75+
Once it is complete (without errors), store it as a Vagrant base box. It will appear as `islandora_base` in the current directory.
76+
```bash
77+
$ vagrant package --output islandora_base
78+
```
79+
80+
Then, get rid of the existing VM since we've saved what we need:
81+
```bash
82+
$ vagrant destroy
83+
default: Are you sure you want to destroy the 'default' VM? [y/N] y
84+
==> default: Forcing shutdown of VM...
85+
==> default: Destroying VM and associated drives...
86+
87+
```
6988

89+
Then, to provision Islandora on top of the new base box:
7090
```bash
7191
vagrant up
7292
```
7393

94+
Access your site at `http://localhost:8000`.
95+
7496
## Deploying to a remote environment
7597

76-
A remote environment can be provisioned by providing SSH credentials to `islandora-playbook` and using the `ansible-galaxy` installer instead of Vagrant. Some preparation of configuration entries in the `inventory` also need to be changed to be aware of the particulars of your remote environment; this includes:
98+
The `ansible-playbook` command using `playbook.yml` can provision a remote environment. First, you will need to create a new folder in `inventory/` with the details of your remote deployment. This includes:
7799

100+
- Configuring the SSH parameters so Ansible can log in
78101
- Changing usernames and passwords to something more sensible than the default
79-
- Changing IP addresses to use the remote machine's actual IP
102+
- Changing IP addresses to use the remote machine's IP
80103
- Changing Apache to serve at port 80 (as opposed to 8000, which we use for development purposes)
81104

82-
We're going to build up this new remote environment configuration from the default provided Vagrant configuration. To start, take the inventory for the vagrant development environment and make a copy of it. Be sure to give it an appropriate name. Here we're using `example`.
105+
Before beginning, you may want to:
106+
107+
- Create a non-root user on the remote machine. Ansible will need to "escalate" (i.e. `sudo`) as this user. See Ansible Docs on [Understanding privilege escalation: become](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html)
108+
- Ensure all ports except the Drupal port and ports used by Ansible are behind a firewall.
109+
110+
We're going to build up this new remote environment configuration from the default provided Vagrant configuration. To start, take the inventory for the `vagrant` development environment and make a copy of it. Be sure to give it an appropriate name. Here we're using `production`.
83111

84112
```bash
85113
$ git clone https://github.com/Islandora-Devops/islandora-playbook
86114
$ cd islandora-playbook
87-
$ cp -r inventory/vagrant inventory/example
115+
$ cp -r inventory/vagrant inventory/production
88116
```
89117

90118
Then you can update the following entries in the following files using your own information. If an entry does not exist in a file,
@@ -96,79 +124,24 @@ your own values.
96124
#### group_vars/all/passwords.yml
97125

98126
```yml
127+
# Drupal
99128
drupal_db_password: changeme
100129
drupal_account_pass: changeme
101-
islandora_db_root_password: changeme
102-
islandora_tomcat_password: changeme
103-
islandora_syn_token: changeme
104-
cantaloupe_admin_password: changeme
105-
```
106130

107-
#### group_vars/crayfish.yml
131+
# MySQL/Postgres
132+
islandora_db_root_password: changeme
108133

109-
```yml
110-
crayfish_gemini_fedora_base_url: http://example.org:8080/fcrepo/rest
111-
crayfish_houdini_fedora_base_url: http://example.org:8080/fcrepo/rest
112-
crayfish_hypercube_fedora_base_url: http://example.org:8080/fcrepo/rest
113-
crayfish_milliner_fedora_base_url: http://example.org:8080/fcrepo/rest
114-
crayfish_milliner_drupal_base_url: http://example.org
115-
crayfish_milliner_gemini_base_url: http://example.org/gemini
116-
crayfish_homarus_fedora_base_url: http://example.org:8080/fcrepo/rest
117-
crayfish_recast_fedora_base_url: http://example.org:8080/fcrepo/rest
118-
crayfish_recast_drupal_base_url: http://example.org
119-
crayfish_recast_gemini_base_url: http://example.org/gemini
120-
```
134+
# Tomcat
135+
islandora_tomcat_password: changeme
121136

122-
#### group_vars/karaf.yml
137+
# Syn
138+
islandora_syn_token: changeme
123139

124-
For Alpaca, only the `token.value` and various URLs are of particular importance, but the entire configuration chunk is provided here for convenience.
140+
# Cantaloupe
141+
cantaloupe_admin_password: changeme
125142

126-
```yml
127-
alpaca_settings:
128-
- pid: ca.islandora.alpaca.http.client
129-
settings:
130-
token.value: changeme
131-
- pid: org.fcrepo.camel.indexing.triplestore
132-
settings:
133-
input.stream: activemq:topic:fedora
134-
triplestore.reindex.stream: activemq:queue:triplestore.reindex
135-
triplestore.baseUrl: http://example.org:8080/bigdata/namespace/islandora/sparql
136-
- pid: ca.islandora.alpaca.indexing.triplestore
137-
settings:
138-
error.maxRedeliveries: 10
139-
index.stream: activemq:queue:islandora-indexing-triplestore-index
140-
delete.stream: activemq:queue:islandora-indexing-triplestore-delete
141-
triplestore.baseUrl: http://example.org:8080/bigdata/namespace/islandora/sparql
142-
- pid: ca.islandora.alpaca.indexing.fcrepo
143-
settings:
144-
error.maxRedeliveries: 5
145-
node.stream: activemq:queue:islandora-indexing-fcrepo-content
146-
node.delete.stream: activemq:queue:islandora-indexing-fcrepo-delete
147-
media.stream: activemq:queue:islandora-indexing-fcrepo-media
148-
file.stream: activemq:queue:islandora-indexing-fcrepo-file
149-
file.delete.stream: activemq:queue:islandora-indexing-fcrepo-file-delete
150-
milliner.baseUrl: http://example.org/milliner/
151-
gemini.baseUrl: http://example.org/gemini/
152-
153-
alpaca_blueprint_settings:
154-
- pid: ca.islandora.alpaca.connector.houdini
155-
in_stream: activemq:queue:islandora-connector-houdini
156-
derivative_service_url: http://example.org/houdini/convert
157-
error_max_redeliveries: 5
158-
camel_context_id: IslandoraConnectorHoudini
159-
- pid: ca.islandora.alpaca.connector.homarus
160-
in_stream: activemq:queue:islandora-connector-homarus
161-
derivative_service_url: http://example.org/homarus/convert
162-
error_max_redeliveries: 5
163-
camel_context_id: IslandoraConnectorHomarus
164-
```
165-
166-
#### group_vars/tomcat.yml
167-
168-
```yml
169-
fcrepo_allowed_external_content:
170-
- http://example.org/
171-
cantaloupe_HttpResolver_BasicLookupStrategy_url_prefix: http://example.org/
143+
# Fedora
144+
fcrepo_db_password: changeme
172145
```
173146
174147
#### group_vars/webserver/apache.yml
@@ -178,54 +151,42 @@ This is where we specify that the webserver is listening on the default port 80,
178151
apache_listen_port: 80
179152
```
180153
181-
#### group_vars/webserver/drupal.yml
182-
183-
```yml
184-
drupal_trusted_hosts:
185-
- ^localhost$
186-
- example.org
187-
fedora_base_url: "http://example.org:8080/fcrepo/rest/"
188-
```
189-
190154
#### group_vars/webserver/general.yml
191155
156+
You will have to add the matomo line.
157+
192158
```yml
193-
openseadragon_iiiv_server: http://example.org:8080/cantaloupe/iiif/2
194159
matomo_site_url: http://example.org
195160
```
196161
197162
#### hosts
198163
199-
You'll need the SSH particulars for logging into your server in the `inventory/vagrant/hosts` file . This example is set up to login as `root` using
164+
You'll need to put particulars for logging into your server in the `inventory/production/hosts` file . This example is set up to login as the `ansible` user (to avoid trying to run Composer as `root`) and uses
200165
an SSH key. You'll need to get the details for logging into your remote server from your hosting provider (AWS, Digital Ocean, etc...)
201166
or your systems administrator if you're running the server in-house. See
202167
[this page](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#connecting-to-hosts-behavioral-inventory-parameters)
203168
for more details about what you can put into a
204169
host file
170+
[//]: # (How to avoid getting asked for a sudo password? Use -K in the command below? Configuring passwordless sudo seemed to not work. no idea how vagrant does it.)
205171

206172
```
207-
default ansible_host=example.org ansible_port=22 ansible_user=root ansible_ssh_private_key_file='/home/username/.ssh/id_rsa'
173+
default ansible_host=example.org ansible_port=22 ansible_user=ansible ansible_ssh_private_key_file='/home/username/.ssh/id_rsa'
208174
```
209175

210176
### Running the remote installer
211177

212-
First, you'll want to get the ansible roles that are needed for the version of Islandora you are trying to install. This can be done
178+
First, you'll want to install the ansible roles that are needed for the version of Islandora you are trying to install. This can be done
213179
with
214180

215181
```bash
216182
$ ansible-galaxy install -r requirements.yml
217183
```
218184

219-
Then, depending on the operating system installed on the remote environment, you can use the following command for Ubuntu 16.04
185+
Then, if you are on Ubuntu 22.04, run the following commands:
220186

221187
```bash
222-
$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=ubuntu/xenial64"
223-
```
224-
225-
or for CentOS 7
226-
227-
```bash
228-
$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=centos/7"
188+
$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=ubuntu/jammy64" -e "islandora_profile=starter" -e "islandora_build_base_box=true"
189+
$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=ubuntu/jammy64" -e "islandora_profile=starter" -e "islandora_build_base_box=false"
229190
```
230191

231192
## Troubleshooting
@@ -265,3 +226,4 @@ change this, set a new value for `ansible_port` in `inventory/vagrant/hosts`.
265226
If you run into any issues installing the environment, do not hesitate to email the [mailing list](mailto:[email protected]) to
266227
ask for help. If you think you've stumbled across a bug in the installer, please create an issue in the
267228
[Islandora issue queue](http://github.com/Islandora/documentation/issues) and give it an `ansible` tag.
229+

0 commit comments

Comments
 (0)