Skip to content

Commit

Permalink
Update to 18.04 (Islandora-Devops#125)
Browse files Browse the repository at this point in the history
* Update to 18.04

- Update Vagrantfile to use 18.04 for Ubuntu builds
- Tweak package names, and required packages for 18.04
- Updates to get rid of some deprecation warnings
- Addresses Islandora/documentation#848
- Requires islandora-deprecated/ansible-role-grok#6

* Update README and remove some cruft per @Natkeeran's review.

* use ansible-role-grok 2.0.0

* review

* cut more
  • Loading branch information
ruebot authored and whikloj committed Dec 18, 2019
1 parent 8df1246 commit 2006965
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 26 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ export ISLANDORA_VAGRANT_MEMORY=4096

_CENTOS support is WIP and not to be considered stable_

Ubuntu 16.04 is the default linux distribution used by claw-playbook. If you want to use CENTOS 7 instead, set the `ISLANDORA_DISTRO` environment variable to `centos/7`. The easiest way to do this is to export the environment variable into your shell before running Vagrant commands. Otherwise you will have to provide the variable for every Vagrant command you issue.
Ubuntu 18.04 is the default linux distribution used by claw-playbook. If you want to use CENTOS 7 instead, set the `ISLANDORA_DISTRO` environment variable to `centos/7`. The easiest way to do this is to export the environment variable into your shell before running Vagrant commands. Otherwise you will have to provide the variable for every Vagrant command you issue.

```bash
ISLANDORA_DISTRO="centos/7" vagrant up
ISLANDORA_DISTRO="centos/7" vagrant ssh
```

If you are not using `vagrant up` to bring up a box, and are running `ansible-playbook` against it manually, you will need to set `ansible_ssh_user` to `vagrant` for your hosts. It's easiest to add this value to `inventory/vagrant/group_vars/all.yml` to set the value for all hosts. This is not neccessary if using Vagrant, as the ssh user is passed to ansible via the Vagrantfile.
If you are not using `vagrant up` to bring up a box, and are running `ansible-playbook` against it manually, you will need to set `ansible_ssh_user` to `vagrant` for your hosts. It's easiest to add this value to `inventory/vagrant/group_vars/all.yml` to set the value for all hosts. This is not neccessary if using Vagrant, as the ssh user is passed to ansible via the Vagrantfile.

## Use

Expand Down Expand Up @@ -77,9 +77,7 @@ More information about inventories can be found in the [ansible documentation](h
* milliner.baseUrl `inventory/production/group_vars/karaf.yml`
1. Any other variable changes you wish.
1. Install the roles using `ansible-galaxy`: `$ ansible-galaxy install -r requirements.yml`
1. Provision the server:
- If the host you are provisioning is a Ubuntu 16.04 machine, you may wish to have the playbook install Python for you. This is a requirement to run the playbook. You can do this by passing an additional variable on the command line like this. `$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=ubuntu/xenial64"`
- If the host you are provisioning is a Centos/7 machine, you may wish to have the playbook install Python for you. This is a requirement to run the playbook. You can do this by passing an additional variable on the command line like this. `$ ansible-playbook -i inventory/production playbook.yml -e "islandora_distro=centos/7"`
1. Provision the server: `$ ansible-playbook -i inventory/production playbook.yml`

## Connect

Expand Down
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ $hostname = ENV.fetch("ISLANDORA_VAGRANT_HOSTNAME", "claw")
$virtualBoxDescription = ENV.fetch("ISLANDORA_VAGRANT_VIRTUALBOXDESCRIPTION", "IslandoraCLAW")

# Available boxes are 'ubuntu/xenial64' and 'centos/7'
$vagrantBox = ENV.fetch("ISLANDORA_DISTRO", "ubuntu/xenial64")
$vagrantBox = ENV.fetch("ISLANDORA_DISTRO", "ubuntu/bionic64")

# On Ubuntu, user is ubuntu, on all others, user is vagrant
$vagrantUser = if $vagrantBox == "ubuntu/xenial64" then "ubuntu" else "vagrant" end
$vagrantUser = if $vagrantBox == "ubuntu/bionic64" then "ubuntu" else "vagrant" end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v|
Expand Down
10 changes: 0 additions & 10 deletions bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
gather_facts: false

tasks:
# python isn't installed by default on ubuntu 16.04 so we need
# to do that with the raw command before
- name: install python
raw: test -e /usr/bin/python || (apt-get update; apt-get install -y python;)
register: output
changed_when:
- output.stdout != ""
- output.stdout != "\r\n"
when: islandora_distro|default('') == "ubuntu/xenial64"

# Manually gather facts once python is installed
- name: gather facts
setup:
Expand Down
1 change: 1 addition & 0 deletions inventory/vagrant/group_vars/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ islandora_extra_ubuntu_packages:
- unzip
- build-essential
- vim
- python3-mysqldb

islandora_extra_centos_packages:
- wget
Expand Down
16 changes: 8 additions & 8 deletions playbook.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

- include: bootstrap.yml
- import_playbook: bootstrap.yml
tags:
- bootstrap
- include: database.yml
- include: solr.yml
- include: webserver.yml
- include: tomcat.yml
- include: crayfish.yml
- include: karaf.yml
- include: post-install.yml
- import_playbook: database.yml
- import_playbook: solr.yml
- import_playbook: webserver.yml
- import_playbook: tomcat.yml
- import_playbook: crayfish.yml
- import_playbook: karaf.yml
- import_playbook: post-install.yml
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

- src: https://github.com/Islandora-Devops/ansible-role-grok
name: Islandora-Devops.grok
version: 1.0.0
version: 2.0.0

- src: https://github.com/Islandora-Devops/ansible-role-karaf
name: Islandora-Devops.karaf
Expand Down

0 comments on commit 2006965

Please sign in to comment.