Skip to content

Commit

Permalink
#243 initial Rocky 9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
don sizemore committed Jul 22, 2022
1 parent 8863baf commit 30e32fa
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Here is an example of how to execute the `dataverse-ansible` role with more adju
| -e | Extra variables file | no |
| -v | run with Verbosity (up to three Vs) | no |

The role currently supports RHEL/CentOS 7, RHEL/Rocky 8 and Debian 11 with all services running on the same machine, but intends to become OS-agnostic and support multiple nodes for scalability.
The role currently supports RHEL/CentOS 7, RHEL/Rocky 8/9 and Debian 11 with all services running on the same machine, but intends to become OS-agnostic and support multiple nodes for scalability.

If you're interested in testing Dataverse locally using [Vagrant][vagrant], you'll want to clone this repository and edit the local port redirects if the http/https ports on your local machine are already in use. Note that the current Vagrant VM template requires [VirtualBox][virtualbox] 5.0+ and will automatically launch the above command within your Vagrant VM.

Expand Down
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/rockylinux-8"
config.vm.box = "bento/rockylinux-9"

config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder ".", "/etc/ansible/roles/dataverse"
Expand Down Expand Up @@ -36,6 +36,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.provider "virtualbox" do |vbox|
vbox.cpus = 4
vbox.memory = 4096
vbox.memory = 8192
end
end
5 changes: 3 additions & 2 deletions tasks/dataverse-apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@
mode: 0644
notify: enable and restart apache

- name: this package provides semanage on RHEL / Rocky 8
package:
- name: this package provides semanage on RHEL / Rocky 8 and 9
ansible.builtin.package:
name: policycoreutils-python-utils
state: latest
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"
or ansible_distribution_major_version == "9"

- name: remove unnecessary mod_cgi
ansible.builtin.file:
Expand Down
15 changes: 13 additions & 2 deletions tasks/dataverse-counter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
debug:
msg: '##### MAKE DATA COUNT #####'

- name: ensure python3-pip. Ansible on RHEL/Rocky now requires 3.8
yum:
- name: ensure python3-pip. Ansible on RHEL/Rocky 8 now requires 3.8
ansible.builtin.package:
name: python38-pip
state: latest
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"

- name: ensure python39-pip on RHEL/Rocky 9
ansible.builtin.package:
name: python3-pip
state: latest
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "9"

- name: ensure counter user exists
user:
Expand Down
4 changes: 2 additions & 2 deletions tasks/dataverse-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
set_fact:
python_bin: '/usr/bin/python3'
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"
- ansible_os_family == "RedHat" and
(ansible_distribution_major_version == "8") or (ansible_distribution_major_version == "9")

- name: Debian only offers Python3 nowadays
set_fact:
Expand Down
13 changes: 10 additions & 3 deletions tasks/dataverse-prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,23 @@
name: ['bash-completion', 'git', 'jq', 'mlocate', 'net-tools', 'sudo', 'unzip', 'python3-psycopg2', 'zip', 'tar']
state: latest

- name: "RHEL/Rocky 8.6 provides Ansible 5.4 which wants Python-3.8"
- name: "RHEL/Rocky 8.6 packaged Ansible wants Python-3.8"
ansible.builtin.package:
name: ['python38-psycopg2']
state: latest
when: ansible_os_family == "RedHat" and
ansible_distribution_major_version == "8"

- name: "RHEL/Rocky 9 provides 3.9"
ansible.builtin.package:
name: python3-psycopg2
state: latest
when: ansible_os_family == "RedHat" and
ansible_distribution_major_version == "9"

- name: install java-nnn-openjdk and other packages for RedHat/Rocky
yum:
name: ['java-{{ java.version }}-openjdk-devel', 'python38', 'vim-enhanced']
name: ['java-{{ java.version }}-openjdk-devel', 'vim-enhanced']
state: latest
when: ansible_os_family == "RedHat"

Expand All @@ -70,7 +77,7 @@
name: GraphicsMagick
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"
- ansible_distribution_major_version == "8" or ansible_distribution_major_version == "9"
- dataverse.thumbnails

- name: install GraphicsMagic on Debian/Ubuntu for thumbnail generation
Expand Down
2 changes: 1 addition & 1 deletion tasks/payara.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@
mode: '0750'
state: directory

- name: flush hadlers to start payara and possibly reload systemd
- name: flush handlers to start payara and possibly reload systemd
meta: flush_handlers
2 changes: 1 addition & 1 deletion tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
state: present
when: ansible_os_family == "RedHat"

- name: "RHEL/Rocky8: disable PostgreSQL proper in the OS"
- name: "RHEL/Rocky 8: disable PostgreSQL OS module"
shell: 'dnf -qy module disable postgresql'
when: ansible_os_family == "RedHat" and
ansible_distribution_major_version == "8"
Expand Down
13 changes: 9 additions & 4 deletions tasks/rserve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@
state: latest
when: ansible_os_family == "RedHat"

- name: RHEL8 needs codeready-builder
- name: RHEL8/9 need codeready-builder
rhsm_repository:
name: codeready-builder-for-rhel-8-x86_64-rpms
when: ansible_distribution == "RedHat" and
ansible_distribution_major_version == "8"
when: (ansible_distribution == "RedHat" and ansible_distribution_major_version == "8") or
(ansible_distribution == "RedHat" and ansible_distribution_major_version == "9")

- name: Rocky needs powertools
- name: Rocky 8 needs powertools
shell: "dnf config-manager --enable powertools"
when: ansible_distribution == "Rocky" and
ansible_distribution_major_version == "8"

- name: Rocky 9 calls it codeready-builder
shell: "dnf config-manager --enable crb"
when: ansible_distribution == "Rocky" and
ansible_distribution_major_version == "9"

- name: install base packages
yum:
name: "{{ packages }}"
Expand Down
11 changes: 11 additions & 0 deletions tasks/sampledata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
ansible.builtin.package:
name: python38-pip
state: latest
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"

- name: "RHEL/Rocky 9 package Python-3.9"
ansible.builtin.package:
name: python3-pip
state: latest
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "9"

- name: clone sampledata repo
git:
Expand Down
7 changes: 7 additions & 0 deletions tasks/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
ansible_distribution_major_version == "8" and
db.postgres.version < 10

- name: RHEL9 and RockyLinux likely require PG13
set_fact:
die: "RHEL/Rocky 9 packages PostgresQL 13 and likely won't work with earlier versions."
when: ansible_os_family == "RedHat" and
ansible_distribution_major_version == "9" and
db.postgres.version < 13

- name: Shibboleth requires AJP
set_fact:
die: "Shibboleth requires AJP"
Expand Down
33 changes: 18 additions & 15 deletions tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,32 @@
- policycoreutils
when: ansible_os_family == 'RedHat'

# Ansible seboolean module is broken on RHEL/Rocky 8.6. dls 20220602
#- name: set httpd_can_network_connect on and keep it persistent across reboots
# seboolean:
# name: httpd_can_network_connect
# state: yes
# persistent: yes
# when: ansible_os_family == 'RedHat'
- name: set httpd_can_network_connect on and keep it persistent across reboots
seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == "9"

# Ansible seboolean module is broken on RHEL/Rocky 8.6, use shell cmd instead.
- name: allow apache to make outbound connections
shell: '/usr/sbin/setsebool -P httpd_can_network_connect 1'
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "8"

# Ansible seboolean module is broken on RHEL/Rocky 8.6. dls 20220602
#- name: allow apache to read user content by default
# seboolean:
# name: httpd_read_user_content
# state: yes
# persistent: yes
# when:
# - ansible_os_family == "RedHat"
- name: allow apache to read user content by default
seboolean:
name: httpd_read_user_content
state: yes
persistent: yes
when:
- ansible_os_family == "RedHat"
- ansible_distribution_major_version == "9"

# Ansible seboolean module is broken on RHEL/Rocky 8.6. dls 20220602
- name: allow apache to read user content by default
shell: 'setsebool -P httpd_read_user_content 1'
when:
Expand Down
2 changes: 2 additions & 0 deletions tasks/shibboleth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
when: (ansible_distribution == "RedHat" and ansible_distribution_major_version == "8")
or (ansible_distribution == "CentOS" and ansible_distribution_major_version == "8")

# there is no Shibboleth repo for RHEL/Rocky 9 just yet. dls 20220721

- name: install Shibboleth RPMs for RHEL and derivatives
ansible.builtin.package:
name: shibboleth
Expand Down
4 changes: 2 additions & 2 deletions tests/group_vars/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# dataverse/tests/group_vars/vagrant.yml

# un-nested so we can pass them at the CLI
dataverse_branch: develop
dataverse_branch: release
dataverse_repo: https://github.com/IQSS/dataverse.git
any_errors_fatal: true

Expand Down Expand Up @@ -45,7 +45,7 @@ dataverse:
blocked_endpoints: "admin,test"
blocked_policy: "localhost-only"
location: "http://localhost:8080/api"
test_suite: false
test_suite: true
# possible test values from https://github.com/IQSS/dataverse/blob/develop/conf/docker-aio/run-test-suite.sh#L11
# beware DataversesIT and DatasetsIT at minimum must be run for any other tests to succeed. have fun.
#tests: "DataversesIT,DatasetsIT,AdminIT"
Expand Down

0 comments on commit 30e32fa

Please sign in to comment.