Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 24.04 #133

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clamav/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: clamav
image: ubuntu:20.04
image: ubuntu:24.04
privileged: true
pre_build_image: false
provisioner:
Expand Down
2 changes: 1 addition & 1 deletion reverse_proxy/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: restart nginx
become: true
service:
name: nginx
name: openresty
state: restarted
enabled: true

Expand Down
2 changes: 1 addition & 1 deletion reverse_proxy/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: reverse_proxy
image: ubuntu:20.04
image: ubuntu:24.04
privileged: true
pre_build_image: false
provisioner:
Expand Down
46 changes: 21 additions & 25 deletions reverse_proxy/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

- name: nginx is installed
assert:
that: services.ansible_facts.services.nginx is defined
that: services.ansible_facts.services.openresty is defined
fail_msg: "No nginx service was defined"
success_msg: "Nginx service found!"

- name: nginx is running
assert:
that: services.ansible_facts.services['nginx'].state == "running"
that: services.ansible_facts.services['openresty'].state == "running"
fail_msg: "The nginx service does not appear to be running"
success_msg: "Nginx service is running"

Expand Down Expand Up @@ -64,29 +64,25 @@
fail_msg: "Request to valid file extension was blocked."
success_msg: "Request to valid file extension was not blocked."

# Ubuntu 20.04 uses R 3, and packages for R 3 are no longer
# available in CRAN. We can sort this out when we move to Ubuntu
# 22.04 or later:

# - name: r package installation
# shell:
# cmd: |
# rm -rf /usr/local/lib/R/site-library/dplyr # remove if installed
# /usr/bin/R --no-save <<RPROG
# install.packages("dplyr", repos="http://cran.{{zone}}")
# library('dplyr')
# q()
# RPROG
# ls /usr/local/lib/R/site-library/dplyr
# failed_when: false
# changed_when: false
# register: r_install

# - name: ensure r package installed successfully
# assert:
# that: r_install.rc == 0
# fail_msg: "Failed to install R package (dplyr) from local proxy"
# success_msg: "R package (dplyr) was successfully installed via local proxy"
- name: r package installation
shell:
cmd: |
rm -rf /usr/local/lib/R/site-library/dplyr # remove if installed
/usr/bin/R --no-save <<RPROG
install.packages("dplyr", repos="http://cran.{{zone}}")
library('dplyr')
q()
RPROG
ls /usr/local/lib/R/site-library/dplyr
failed_when: false
changed_when: false
register: r_install

- name: ensure r package installed successfully
assert:
that: r_install.rc == 0
fail_msg: "Failed to install R package (dplyr) from local proxy"
success_msg: "R package (dplyr) was successfully installed via local proxy"

- name: check avscanner headers
uri:
Expand Down
2 changes: 1 addition & 1 deletion reverse_proxy/tasks/bioconductor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: add our bioconductor reverse proxy config
become: true
template:
dest: /etc/nginx/sites-enabled/bioconductor.conf
dest: /etc/openresty/sites-enabled/bioconductor.conf
src: generic.conf.j2
vars:
generic_name: bioconductor
Expand Down
2 changes: 1 addition & 1 deletion reverse_proxy/tasks/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: add our conda-forge reverse proxy config
become: true
template:
dest: /etc/nginx/sites-enabled/conda.conf
dest: /etc/openresty/sites-enabled/conda.conf
src: generic.conf.j2
vars:
generic_name: conda
Expand Down
2 changes: 1 addition & 1 deletion reverse_proxy/tasks/cran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: add our cran reverse proxy config
become: true
template:
dest: /etc/nginx/sites-enabled/cran.conf
dest: /etc/openresty/sites-enabled/cran.conf
src: generic.conf.j2
vars:
generic_name: cran
Expand Down
44 changes: 38 additions & 6 deletions reverse_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
---
- name: install gnupg
become: true
apt:
update_cache: true
name:
- gnupg

- name: install openresty repository key
become: true
apt_key:
url: https://openresty.org/package/pubkey.gpg
id: E52218E7087897DC6DEA6D6D97DB7443D5EDEB74

- name: add openresty repository
when: ansible_architecture == "x86_64"
ansible.builtin.apt_repository:
repo: deb http://openresty.org/package/ubuntu noble main
state: present

- name: add openresty repository
when: ansible_architecture == "aarch64"
ansible.builtin.apt_repository:
repo: deb http://openresty.org/package/arm64/ubuntu noble main
state: present

- name: install nginx
become: true
apt:
update_cache: true
install_recommends: false
name:
- nginx-extras # for proxying
- git # for testing
- openresty

- name: remove default site configuration
become: true
file:
path: /etc/nginx/sites-enabled/default
state: absent
- name: ensure openresty includes enabled sites
ansible.builtin.lineinfile:
path: /etc/openresty/nginx.conf
insertafter: "default_type"
line: "include /etc/openresty/sites-enabled/*.conf;"

- name: create sites-enabled directory
ansible.builtin.file:
path: /etc/openresty/sites-enabled
state: directory

- include_tasks: cran.yml
- include_tasks: bioconductor.yml
Expand Down
3 changes: 2 additions & 1 deletion reverse_proxy/templates/generic.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ server {

-- Launch the antivirus scanner on the temporary file.
local t_start = os.clock()
local ret = os.execute("{{ av_scanner }} " .. path)
local ret = 1
_, _, ret = os.execute("{{ av_scanner }} " .. path)
local t_end = os.clock()

os.remove(path)
Expand Down
2 changes: 1 addition & 1 deletion squid/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: instance
image: ubuntu:20.04
image: ubuntu:24.04
privileged: true
pre_build_image: false
provisioner:
Expand Down