Skip to content

Commit 10fe7cd

Browse files
alanbchristiea.b.christie
andauthored
ci: Removed ansible galaxy logic (broken) (#1)
Co-authored-by: a.b.christie <alan.christie@matildapeak.com>
1 parent 01da3e8 commit 10fe7cd

12 files changed

+17
-210
lines changed

roles/fragnet/tasks/deploy-depict.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
- name: Deploy Fragnet Depict objects
44
k8s:
5-
definition: "{{ lookup('template', '{{ item }}.yaml.j2') }}"
5+
definition: "{{ lookup('template', item) }}"
66
wait: yes
77
wait_timeout: "{{ fs_pod_ready_timeout }}"
88
loop:
9-
- deployment-depict
9+
- deployment-depict.yaml.j2

roles/fragnet/tasks/deploy-search.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838
- name: Deploy Fragnet Search objects (fs_image_tag={{ fs_image_tag }})
3939
k8s:
40-
definition: "{{ lookup('template', '{{ item }}.yaml.j2') }}"
40+
definition: "{{ lookup('template', item) }}"
4141
wait: yes
4242
wait_timeout: "{{ fs_pod_ready_timeout }}"
4343
loop:
44-
- configmap-common
45-
- configmap-keycloak-search
46-
- deployment-search
44+
- configmap-common.yaml.j2
45+
- configmap-keycloak-search.yaml.j2
46+
- deployment-search.yaml.j2

roles/fragnet/tasks/deploy-ui.yaml

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,6 @@
44
include_vars:
55
file: pull-secrets.vault
66

7-
# Adjust the Keycloak realm?
8-
9-
- name: Adjust keycloak realm
10-
block:
11-
12-
# Configure the Fragnet Search UI Keycloak Client.
13-
#
14-
# The user is assumed to have created a realm
15-
# and we simply need to add a Role to that realm and then
16-
# register the Fragnet Search Client.
17-
18-
- name: Set client address
19-
set_fact:
20-
fs_client_hostname: "{{ fs_location['ui'].hostname }}{{ fs_location['ui'].path }}"
21-
22-
- name: Display client address
23-
debug:
24-
var: fs_client_hostname
25-
26-
- import_tasks: get-keycloak-realm-manager-credentials.yaml
27-
vars:
28-
realm_name: "{{ fs_realm }}"
29-
realm_namespace: "{{ ir_namespace }}"
30-
31-
- name: Add realm roles
32-
include_role:
33-
name: informaticsmatters.infrastructure_user
34-
vars:
35-
iu_action: create
36-
iu_type: role
37-
iu_hostname: "{{ keycloak_server_url|urlsplit('hostname') }}"
38-
iu_realm: "{{ fs_realm }}"
39-
iu_realm_manager: "{{ keycloak_realm_manager_fact }}"
40-
iu_realm_manager_password: "{{ keycloak_realm_manager_password_fact }}"
41-
iu_roles:
42-
- name: fragnet-search
43-
44-
- name: Add Keycloak Fragnet Search Client
45-
keycloak_client:
46-
auth_client_id: admin-cli
47-
auth_keycloak_url: "{{ keycloak_server_url }}"
48-
auth_realm: "{{ fs_realm }}"
49-
auth_username: "{{ keycloak_realm_manager_fact }}"
50-
auth_password: "{{ keycloak_realm_manager_password_fact }}"
51-
realm: "{{ fs_realm }}"
52-
client_id: "{{ fs_keycloak_client_id }}"
53-
protocol: openid-connect
54-
base_url: https://{{ fs_client_hostname }}
55-
web_origins:
56-
- https://{{ fs_client_hostname }}
57-
redirect_uris:
58-
- https://{{ fs_client_hostname }}/*
59-
public_client: yes
60-
service_accounts_enabled: yes
61-
direct_access_grants_enabled: yes
62-
standard_flow_enabled: yes
63-
default_roles:
64-
- fragnet-search
65-
delegate_to: localhost
66-
67-
when: fs_alter_realm|bool
68-
697
# Create secret objects for each image pull secret defined.
708
# These are typically used to pull container images
719
# from private registries.
@@ -81,10 +19,10 @@
8119

8220
- name: Deploy Fragnet UI objects
8321
k8s:
84-
definition: "{{ lookup('template', '{{ item }}.yaml.j2') }}"
22+
definition: "{{ lookup('template', item) }}"
8523
wait: yes
8624
wait_timeout: "{{ fs_pod_ready_timeout }}"
8725
loop:
88-
- configmap-common
89-
- configmap-ui
90-
- deployment-ui
26+
- configmap-common.yaml.j2
27+
- configmap-ui.yaml.j2
28+
- deployment-ui.yaml.j2

roles/fragnet/tasks/deploy.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,10 @@
3939

4040
- name: Create namespace objects
4141
k8s:
42-
definition: "{{ lookup('template', '{{ item }}.yaml.j2') }}"
42+
definition: "{{ lookup('template', item) }}"
4343
wait: yes
4444
loop:
45-
- serviceaccount
46-
- role
47-
- rolebinding-fs-sa
48-
49-
- name: Relax {{ fs_namespace }}§ 'default' service account (for cert-manager)
50-
k8s:
51-
definition: "{{ lookup('template', 'rolebinding-default-sa.yaml.j2') }}"
52-
wait: yes
45+
- serviceaccount.yaml.j2
5346

5447
# Deploy Search, Depict or UI?
5548

roles/fragnet/tasks/get-keycloak-realm-manager-credentials.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

roles/fragnet/tasks/main.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
- name: Assert authentication
1212
assert:
1313
that:
14-
- k8s_auth_host|length > 0
15-
- k8s_auth_api_key|length > 0
14+
- k8s_auth_host | length > 0
15+
- k8s_auth_api_key | length > 0
1616

1717
# Go...
1818

1919
- block:
2020

2121
- include_tasks: deploy.yaml
22-
when: fs_state|string == 'present'
22+
when: fs_state | string == 'present'
2323
- include_tasks: undeploy.yaml
24-
when: fs_state|string == 'absent'
24+
when: fs_state | string == 'absent'
2525

2626
module_defaults:
2727
group/k8s:

roles/fragnet/tasks/prep.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@
3939
- { name: 'openshift', version: '0.10.0' }
4040
when: fs_control_needs_kubernetes|bool
4141

42-
# Install required Ansible Galaxy modules
43-
44-
- name: Install Ansible Galaxy modules
45-
command: ansible-galaxy install -r infrastructure-realm-requirements.yaml
46-
register: ag_result
47-
changed_when: "'downloading role' in ag_result.stdout"
48-
4942
# Kubernetes credentials ------------------------------------------------------
5043

5144
# We don't use the Kubernetes credentials directly,

roles/fragnet/tasks/undeploy.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,3 @@
1010
state: absent
1111
definition: "{{ lookup('template', 'namespace.yaml.j2') }}"
1212
wait: yes
13-
14-
# ...and then clean-up the infrastructure?
15-
# Yes if fs_alter_realm is 'yes'
16-
17-
- block:
18-
19-
- import_tasks: get-keycloak-realm-manager-credentials.yaml
20-
vars:
21-
realm_name: "{{ fs_realm }}"
22-
realm_namespace: "{{ ir_namespace }}"
23-
24-
- name: Delete Fragnet Search Client
25-
keycloak_client:
26-
auth_client_id: admin-cli
27-
auth_keycloak_url: "{{ keycloak_server_url }}"
28-
auth_realm: "{{ fs_realm }}"
29-
auth_username: "{{ keycloak_realm_manager_fact }}"
30-
auth_password: "{{ keycloak_realm_manager_password_fact }}"
31-
realm: "{{ fs_realm }}"
32-
client_id: "{{ fs_keycloak_client_id }}"
33-
state: absent
34-
delegate_to: localhost
35-
36-
- name: Delete role
37-
include_role:
38-
name: informaticsmatters.infrastructure_user
39-
vars:
40-
iu_action: delete
41-
iu_type: role
42-
iu_hostname: "{{ keycloak_server_url|urlsplit('hostname') }}"
43-
iu_realm: "{{ fs_realm }}"
44-
iu_realm_manager: "{{ keycloak_realm_manager_fact }}"
45-
iu_realm_manager_password: "{{ keycloak_realm_manager_password_fact }}"
46-
iu_roles:
47-
- name: fragnet-search
48-
49-
when: fs_alter_realm|bool

roles/fragnet/templates/ingress.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ metadata:
66
namespace: {{ fs_namespace }}
77
annotations:
88
cert-manager.io/cluster-issuer: "letsencrypt-nginx-{{ fs_cert_issuer|lower }}"
9-
kubernetes.io/ingress.class: "nginx"
109
nginx.ingress.kubernetes.io/cors-allow-origin: "https://{{ fs_cors_allow_origin }}"
1110
nginx.ingress.kubernetes.io/enable-cors: 'true'
1211
nginx.ingress.kubernetes.io/proxy-body-size: "{{ fs_ingress_nginx_proxy_body_size }}"
@@ -15,6 +14,7 @@ metadata:
1514
# For a full set of nginx annotations see...
1615
# https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/
1716
spec:
17+
ingressClassName: nginx
1818
tls:
1919
- hosts:
2020
- {{ fs_location[fs_flavour].hostname }}

roles/fragnet/templates/role.yaml.j2

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)