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

USR OpenShift App #110

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 15 additions & 3 deletions .devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ schemaVersion: 2.2.0
metadata:
name: product-demos
components:
- name: product-demos-ee
- name: tooling-container
container:
image: quay.io/mloriedo/ansible-creator-ee:latest # workaround for https://github.com/eclipse/che/issues/21778
image: quay.io/devspaces/ansible-creator-ee@sha256:04c7aa48f34ab28dc21f36acfe472b249f29c24d1a52d98b2c8da75dd6587d79
memoryRequest: 256M
memoryLimit: 5Gi
memoryLimit: 6Gi
cpuRequest: 250m
cpuLimit: 2000m
args: ['tail', '-f', '/dev/null']
commands:
- id: oc-install
exec:
commandLine: '/usr/local/bin/ansible-playbook ${PROJECT_SOURCE}/.install_oc.yaml'
workingDir: ${PROJECT_SOURCE}
group:
kind: build
isDefault: true
component: tooling-container
events:
postStart:
- "oc-install"
39 changes: 39 additions & 0 deletions .install_oc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: Create
hosts: localhost
connection: local
gather_facts: false
no_log: false
vars:
molecule_pip_dependencies:
- kubernetes
tasks:

- name: Store user ENVs
ansible.builtin.set_fact:
molecule_user_home_dir: "{{ lookup('ansible.builtin.env', 'HOME') }}"
molecule_user_path: "{{ lookup('ansible.builtin.env', 'PATH') }}"

- name: Create local bin directory
ansible.builtin.file:
path: "{{ molecule_user_home_dir }}/bin"
state: directory
mode: 0770

- name: Download oc binary from OCP downloads svc endpoint
ansible.builtin.get_url:
url: http://downloads.openshift-console.svc.cluster.local/amd64/linux/oc
dest: "{{ molecule_user_home_dir }}/bin/oc"
mode: '0770'

- name: Add another bin dir to system-wide $PATH.
ansible.builtin.lineinfile:
path: "{{ molecule_user_home_dir }}/.bashrc"
line: 'PATH=$PATH:{{ molecule_user_home_dir }}/bin'
state: present

- name: Ensure python dependencies are installed
ansible.builtin.pip:
name: "{{ molecule_pip_dependencies }}"
state: present
when: molecule_pip_dependencies is defined
22 changes: 20 additions & 2 deletions openshift/setup.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---
controller_components:
- execution_environments
- credential_types
- projects
- credentials
- inventory_sources
- job_templates
- workflow_job_templates

controller_projects:
- name: USR App
organization: Default
scm_type: git
wait: true
scm_url: https://github.com/willtome/usr-workshop

controller_credentials:
- name: OpenShift Credential
organization: Default
Expand Down Expand Up @@ -186,6 +192,17 @@ controller_templates:
credentials:
- "OpenShift Credential"

- name: OpenShift / USR App
job_type: run
inventory: "Demo Inventory"
project: "USR App"
playbook: "ansible_playbooks/deploy.yaml"
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "OpenShift Credential"

controller_workflows:
- name: OpenShift / CNV / Infra Stack
description: A workflow to deploy Virtualized infra in OCP Virtalization
Expand Down Expand Up @@ -235,3 +252,4 @@ controller_workflows:
unified_job_template: 'SUBMIT FEEDBACK'
extra_data:
feedback: Failed to create CNV instance

Loading