Skip to content

Commit

Permalink
Moved gitea to use existing workload (#7385)
Browse files Browse the repository at this point in the history
* update install-gitea.yml double delay time

* Moved gitea to use existing workload

---------

Co-authored-by: Philip Hayes <[email protected]>
  • Loading branch information
deewhyweb and Philip Hayes authored Nov 17, 2023
1 parent 7208f8a commit 31f1dfe
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 35 deletions.
16 changes: 10 additions & 6 deletions ansible/roles/ocp4-workload-eap8-workshop/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ workshop_rhsso_admin_user_name: admin
workshop_rhsso_admin_password: 'r3dh4t1!'

# Which lab modules to deploy. Semi-colon separated list.
ocp4_workload_eap8_workshop_guides_module_type: ""
ocp4_workload_eap8_workshop_guides_module_type: "m1;m2"

# e.g.
# ocp4_workload_mad_roadshow_guides_module_type: m1;m2;m3;m4;m5

# Array of lab guides. Must match the module_type names
ocp4_workload_eap8_workshop__guides_module_titles: []
# ocp4_workload_eap8_workshop__guides_module_titles: []
# E.g.
# ocp4_workload_mad_roadshow_guides_module_titles:
# - name: m1
# title: "Assessment and Analysis"
# path: "/{{ ocp4_workload_mad_roadshow_guides_repo_name_prefix }}-m1/main/introduction.html"

#module_titles:
# - { name: full, title: "JBoss 7 to JBoss 8 Migration workshop", path: /workshop/EAP8-lab/lab/intro }
# - { name: m1, title: "JBoss 7 to JBoss 8 Migration workshop ", path: /workshop/EAP8-lab/lab/intro }
# - { name: m2, title: "JBoss 7 and JBoss 8 OpenShift workshop ", path: /workshop/EAP8-lab/lab/intro }
ocp4_workload_eap8_workshop__guides_module_titles:
- { name: m1, title: "JBoss 7 to JBoss 8 Migration workshop ", path: /workshop/EAP8-lab/lab/intro }
- { name: m2, title: "JBoss 7 and JBoss 8 re-platform to OpenShift workshop ", path: /workshop/EAP8-lab/lab/intro }


# List of files to be downloaded from cloudfront and uploaded to the artifacts server.
Expand All @@ -41,3 +41,7 @@ filelist:
- postgresql-42.6.0.jar
- mtr-1.1.0.GA-cli-offline.zip

gitea_admin_password: "R3dhat1!"
gitea_git_url: "https://github.com/deewhyweb/eap8-workshop-sample-app.git"


Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
- name: workshop
git:
remotes:
origin: "http://simple-gitea.gitea.svc.cluster.local:3000/{{ user }}/workshop.git"
origin: "https://gitea-gitea.{{ route_subdomain }}/{{ user }}/workshop.git"
checkoutFrom:
revision: main
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

- name: construct url argument for username distribution
set_fact:
guides_urls: "{{ guides_urls + ['https://web-' + item.name + '-guides.' + route_subdomain + item.path + '?userid=%USERNAME%;' + item.title ] if (item.name in modules) else guides_urls }}"
loop: "{{ module_titles }}"
guides_urls: "{{ guides_urls + ['https://web-' + item.name + '-guides.' + route_subdomain + item.path + '?userid=%USERNAME%;' + item.title ] if (item.name in _ocp4_workload_guides_modules) else guides_urls }}"
loop: "{{ ocp4_workload_eap8_workshop__guides_module_titles }}"

- name: deploy username distribution tool
when: r_gau_dc.resources | list | length == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
resources:
requests:
storage: 5Gi
storageClassName: gp3-csi
volumeMode: Filesystem

- name: Create deployment config for download-server
Expand Down
20 changes: 5 additions & 15 deletions ansible/roles/ocp4-workload-eap8-workshop/tasks/post_workload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
user: "{{ item }}"
msg: |
Username: {{ item }}
{% for m in modules %}
{% for m in _ocp4_workload_guides_modules %}
Workshop User Guide: http://web-{{ m }}-guides.{{ route_subdomain }}
{% endfor %}
loop: "{{ users }}"
Expand Down Expand Up @@ -38,26 +38,16 @@
- name: output workshop info guides
agnosticd_user_info:
msg: |
{% for m in modules %}
{% for m in _ocp4_workload_guides_modules %}
Workshop User Guide: http://web-{{ m }}-guides.{{ route_subdomain }}
{% endfor %}
- name: output workshop info guides
- name: output workshop gitea info
agnosticd_user_info:
msg: |
OpenShift credentials for attendees: {{ workshop_openshift_user_name }} / {{ workshop_openshift_user_password }}
CodeReady Workspaces credentials for attendees: {{ workshop_che_user_name }} / {{ workshop_che_user_password }}
OpenShift/Kubernetes API (use with oc login): {{ master_url }}
CodeReady Console: https://codeready-codeready.{{ route_subdomain }}
Admin login with 'admin' / 'admin'
[Instructor Only] Gitea username: gitea
Red Hat SSO Console: https://secure-rhsso-rhsso.{{ route_subdomain }}
Admin login with '{{workshop_rhsso_admin_user_name}}' / '{{workshop_rhsso_admin_password}}'
NOTE: Workspaces in CodeReady are provisioned asynchronously and may not be accessible until rollout finishes shortly.
when: not silent|bool
[Instructor Only] Gitea password: R3dhat1!
# Leave this as the last task in the playbook.
- name: post_workload tasks complete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
retries: 200
delay: 10
until: r_guides_pod.resources | list | length == 1
loop: "{{ modules }}"
loop: "{{ _ocp4_workload_guides_modules }}"

- name: verify guides are accessible
when: num_users | int > 0
uri:
url: http://web-{{ item }}-guides.{{ route_subdomain }}
method: GET
status_code: 200
loop: "{{ modules }}"
loop: "{{ _ocp4_workload_guides_modules }}"

- name: verify codeready pod is running
k8s_info:
Expand Down
26 changes: 18 additions & 8 deletions ansible/roles/ocp4-workload-eap8-workshop/tasks/workload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
- name: Setting up module_type for workshop
debug:
msg: "Setting up module_type for workshop module_type = {{ ocp4-workload-eap8-workshop_guides_module_type }}"
msg: "Setting up module_type for workshop module_type = {{ ocp4_workload_eap8_workshop_guides_module_type }}"

- name: Create module list
ansible.builtin.set_fact:
_ocp4_workload_mad_roadshow_guides_modules: "{{ ocp4-workload-eap8-workshop_guides_module_type.split(';') | map('trim') | list }}"
_ocp4_workload_guides_modules: "{{ ocp4_workload_eap8_workshop_guides_module_type.split(';') | map('trim') | list }}"

- name: Print selected modules
debug:
msg: "Selected list of modules: {{ _ocp4-workload-eap8-workshop_guides_modules }}"
msg: "Selected list of modules: {{ _ocp4_workload_guides_modules }}"

- name: Create CatalogSource Index 4.10
k8s:
Expand All @@ -42,11 +42,21 @@
loop:
- ./files/eap_subscription.yaml

# Install gitea
- name: install gitea
include_tasks: install-gitea.yaml
- name: Install Gitea
ansible.builtin.include_role:
name: ocp4_workload_gitea_operator
vars:
users_int: "{{ num_users | int }}"
ocp4_workload_gitea_user: user1
ocp4_workload_gitea_operator_create_admin: True
ocp4_workload_gitea_operator_admin_password: "{{ gitea_admin_password }}"
ocp4_workload_gitea_operator_create_users: True
ocp4_workload_gitea_operator_migrate_repositories: true
ocp4_workload_gitea_operator_gitea_image_tag: 1.20.0
ocp4_workload_gitea_operator_repositories_list:
- repo: "{{ gitea_git_url }}"
name: "workshop"
private: false


# Install SSO
- name: install SSO
Expand Down Expand Up @@ -83,7 +93,7 @@
include_tasks: install-guides.yaml
vars:
guide: "{{ item }}"
loop: "{{ modules }}"
loop: "{{ _ocp4_workload_guides_modules }}"

- name: install username distribution
when: num_users | int > 0
Expand Down

0 comments on commit 31f1dfe

Please sign in to comment.