Skip to content

Commit

Permalink
Refactor: Split Galaxy Server secret into a dedicated role
Browse files Browse the repository at this point in the history
- without this change, nodeport deployments failed because the web
  service was node created by the time get_node_ip.yml was run.
- Re-enable all PR checks
  • Loading branch information
rooftopcellist committed Apr 30, 2024
1 parent 6215f54 commit bbbc8b0
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 39 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
include:
- STORAGE: filesystem
IMAGE: minimal
# - STORAGE: filesystem
# IMAGE: s6
# - STORAGE: azure
# IMAGE: minimal
# - STORAGE: s3
# IMAGE: minimal
- STORAGE: filesystem
IMAGE: s6
- STORAGE: azure
IMAGE: minimal
- STORAGE: s3
IMAGE: minimal
steps:
- name: PR head repo
id: head_repo_name
Expand Down
1 change: 1 addition & 0 deletions playbooks/galaxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- common
- postgres
- galaxy-web
- galaxy-config

tasks:

Expand Down
2 changes: 0 additions & 2 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,3 @@
- name: Configure Object Storage
include_tasks: object_storage_configuration.yml

- name: Configure Galaxy Server Secret
include_tasks: galaxy_server_secret.yml
1 change: 1 addition & 0 deletions roles/galaxy-config/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
17 changes: 17 additions & 0 deletions roles/galaxy-config/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
galaxy_info:
author: Galaxy-Operator Team
description: A role to setup Galaxy configuration
issue_tracker_url: https://github.com/ansible/galaxy-operator/issues/new
license: GPL-2.0-or-later
company: Red Hat
galaxy_tags:
- galaxy
- pulp
- pulpcore
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
collections:
- operator_sdk.util
- kubernetes.core
Original file line number Diff line number Diff line change
Expand Up @@ -66,33 +66,3 @@
pulp_combined_settings: "{{ default_settings|combine(raw_pulp_settings, recursive=True) if pulp_settings is defined and pulp_settings is not none else default_settings }}"
cacheable: yes
no_log: "{{ no_log }}"

- name: Include redis role
include_role:
name: redis
when: pulp_combined_settings.cache_enabled

- include_tasks:
file: sso-configuration.yml
when:
- sso_secret is defined
- sso_secret | length

- k8s_status:
api_version: "{{ api_version }}"
kind: "{{ kind }}"
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
conditions:
- type: "{{ deployment_type|capitalize }}-API-Ready"
message: "Creating {{ ansible_operator_meta.name }}-server Secret resource"
reason: CreatingServerSecret
status: "False"
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}"

- name: galaxy-server secret
k8s:
state: "{{ deployment_state }}"
definition: "{{ lookup('template', 'templates/galaxy-server.secret.yaml.j2') | from_yaml }}"
register: galaxy_server_secret
no_log: "{{ no_log }}"
20 changes: 20 additions & 0 deletions roles/galaxy-config/tasks/galaxy_server_secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

- k8s_status:
api_version: "{{ api_version }}"
kind: "{{ kind }}"
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
conditions:
- type: "{{ deployment_type|capitalize }}-API-Ready"
message: "Creating {{ ansible_operator_meta.name }}-server Secret resource"
reason: CreatingServerSecret
status: "False"
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}"

- name: galaxy-server secret
k8s:
state: "{{ deployment_state }}"
definition: "{{ lookup('template', 'templates/galaxy-server.secret.yaml.j2') | from_yaml }}"
register: galaxy_server_secret
no_log: "{{ no_log }}"
File renamed without changes.
18 changes: 18 additions & 0 deletions roles/galaxy-config/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

- name: Configure Galaxy Server Secret
include_tasks: combine_galaxy_settings.yml

- name: Include redis role
include_role:
name: redis
when: pulp_combined_settings.cache_enabled

- include_tasks:
file: sso-configuration.yml
when:
- sso_secret is defined
- sso_secret | length

- name: Configure Galaxy Server Secret
include_tasks: galaxy_server_secret.yml
File renamed without changes.
2 changes: 1 addition & 1 deletion roles/postgres/tasks/upgrade_postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,6 @@
- name: Update galaxy-server secret with new postgres host
k8s:
state: "{{ deployment_state }}"
definition: "{{ lookup('template', '../common/templates/galaxy-server.secret.yaml.j2') | from_yaml }}"
definition: "{{ lookup('template', '../galaxy-config/templates/galaxy-server.secret.yaml.j2') | from_yaml }}"
register: galaxy_server_secret
no_log: "{{ no_log }}"

0 comments on commit bbbc8b0

Please sign in to comment.