Skip to content

Commit

Permalink
Merge pull request #3 from khaledk2/rocky9
Browse files Browse the repository at this point in the history
Update to Rocky Linux 9
  • Loading branch information
jburel authored Jan 25, 2024
2 parents 71061c3 + f3801d9 commit 15bfc29
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:

list-scenarios:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.listscenarios.outputs.scenarios }}
steps:
Expand All @@ -22,7 +22,7 @@ jobs:
name: Test
needs:
- list-scenarios
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
# Keep running so we can see if other tests pass
fail-fast: false
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'
- name: Install Ansible & Molecule
run: |
pip install "ansible<8" "ansible-lint<6.13" flake8
Expand All @@ -46,7 +46,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
needs:
- test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Read the role name
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Optional:
- `minio_s3_gateway_bucket`: The bucket to use in the helper scripts if `minio_s3_gateway_install_client` is enabled, default `test`
- `minio_s3_gateway_placeholder_content`: Content of a `README.txt` file that is copied to a new subdirectory if `minio_s3_gateway_install_client` is enabled
- `minio_s3_gateway_port`: Listen on this port, default `9000`
- `docker_version`: The version of Python library for the Docker Engine API, default `7.0.0`


Example Playbook
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ minio_s3_gateway_placeholder_content: "Hello!"

minio_s3_gateway_port: 9000

docker_version: 7.0.0

######################################################################
# Expert users only!
Expand Down
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ galaxy_info:
description: Minio S3 gateway with additional restricted users
company: Open Microscopy Environment
license: BSD
min_ansible_version: 2.6
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- 7
- 9
namespace: ome
role_name: minio_s3_gateway
galaxy_tags: []
22 changes: 0 additions & 22 deletions molecule/default/Dockerfile.j2

This file was deleted.

12 changes: 9 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ lint: |
flake8
platforms:
- name: minio
image: centos/systemd:latest
privileged: true
image: eniocarboni/docker-rockylinux-systemd:9
image_version: latest
command: /sbin/init
privileged: true
cgroupns_mode: host
tmpfs:
- /sys/fs/cgroup
groups:
- docker_hosts
- extra_options
- docker_hosts

provisioner:
name: ansible
lint:
Expand Down
13 changes: 7 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
# minio S3 gateway with custom users in front of an external S3 store
# https://github.com/minio/minio/issues/8045

- name: Install docker-py
- name: Install docker
become: true
yum:
name: docker-python
ansible.builtin.pip:
name: docker
version: "{{ docker_version }}"
state: present

- name: Create docker network
become: true
docker_network:
ansible.builtin.docker_network:
name: "{{ minio_s3_gateway_docker_network }}"

# Etcd required for multiple users on the S3 gateway
# https://github.com/minio/minio/blob/master/docs/sts/etcd.md
- name: Minio etcd
become: true
docker_container:
ansible.builtin.docker_container:
image: "{{ minio_s3_gateway_etcd_image }}"
# Workaround problem with etcd docker directory permissions
# Breaking change going from 3.4.9 → 3.4.10
Expand Down Expand Up @@ -49,7 +50,7 @@
# https://github.com/minio/minio/blob/master/docs/gateway/s3.md
- name: Minio s3 gateway
become: true
docker_container:
ansible.builtin.docker_container:
image: "{{ minio_s3_gateway_minio_image }}"
command: gateway s3 {{ minio_s3_gateway_remote_endpoint }}
name: minio-s3-gateway-minio
Expand Down
14 changes: 7 additions & 7 deletions tasks/minio-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: Download minio client
become: true
get_url:
ansible.builtin.get_url:
# Downloads the latest client, can't find a way to download a particular
# version
url:
Expand All @@ -14,14 +14,14 @@

- name: Copy minio-user.sh
become: true
template:
ansible.builtin.template:
src: minio-user.sh
dest: /usr/local/bin/minio-user.sh
mode: u=rwx,g=rx,o=rx

- name: Create config directories
become: true
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
Expand All @@ -31,21 +31,21 @@

- name: Copy policy-readwrite-subdir.json.template
become: true
copy:
ansible.builtin.copy:
src: policy-readwrite-subdir.json.template
dest: /etc/minio-s3-gateway/policy-readwrite-subdir.json.template
mode: 0644

- name: Create placeholder text file
become: true
copy:
ansible.builtin.copy:
content: "{{ minio_s3_gateway_placeholder_content }}"
dest: /etc/minio-s3-gateway/README.txt
mode: 0644

- name: Create root mc config
become: true
template:
ansible.builtin.template:
src: mc-config-json.j2
dest: /root/.mc/config.json
backup: true
Expand All @@ -54,7 +54,7 @@
# Needed so that it appears in the sudo PATH
- name: Symlink minio client and script to /usr/bin
become: true
file:
ansible.builtin.file:
path: /usr/bin/{{ item }}
src: /usr/local/bin/{{ item }}
state: link
Expand Down

0 comments on commit 15bfc29

Please sign in to comment.