Skip to content

Commit

Permalink
Added modification in playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashansh-Sharma15 committed Jan 30, 2025
1 parent b84f542 commit 00b56de
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 16 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This repository consists of additional ansible playbooks for the following:
1. Cluster Resource Override Operator deployment and e2e test run
1. Deploy MetalLB operator and run e2e
1. Hypershift Agent based installation
1. Deploy Ingress Firewall Operator and run e2e.

## Assumptions:

Expand Down
4 changes: 2 additions & 2 deletions examples/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ fs_volume_size: "100Gi"
iso_url: ""
root_fs_url: ""

#ocp-lso vars
# ocp-ingress-firewall-operator vars
ingress_enabled: false #set to true for ingress firewall operator installation
ingress_catalogsource_image: "" #quay.io/openshift-qe-optional-operators/aosqe-index:v4.17
ingress_catalogsource_name: "" #qe-app-registry
Expand All @@ -435,4 +435,4 @@ ingress_e2e: true
ingress_e2e_github_repo: "https://github.com/openshift/openshift-tests-private"
ingress_e2e_github_branch: "master"
ingress_github_username: ""
ingress_github_token: ""
ingress_github_token: ""
2 changes: 1 addition & 1 deletion playbooks/ocp-ingress-firewall-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- name: Automate ingress firewall operator in OpenShift
hosts: bastion
roles:
- ocp-ingress-firewall-operator
- ocp-ingress-firewall-operator
58 changes: 58 additions & 0 deletions playbooks/roles/ocp-ingress-firewall-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
ocp-ingress-firewall-operator
=========

This role is used to deploy Ingress Firewall Operator in a OCP cluster .

This playbook has two modules:
Installation of the Ingress Firewall Operator.
Running the end to end tests for Ingress Firewall Operator.

Requirements
------------

- Access to the cluster as a user with the cluster-admin role.
- The cluster is in a known good state, without any errors.
- OCP secret with name ***podman-secret*** in the default namespace which is used for global secret update and has following keys: ***username***, ***password*** and ***registry***

Role Variables
--------------

Role Variables
--------------
| Variable | Required | Default | Comments |
|--------------------------------|----------|-------------|------------------------------------------------|
| ingress_enabled | no | false | Set it to true to run this playbook |
| ingress_directory | no | `/tmp/ingress` | Working directory for ingress operator |
| ingress_catalogsource_image | no | | Catlog source index image. |
| ingress_catalogsource_name | no | | Catlog source index name. |
| ingress_namespace | no | | Namespace for deploying ingress operator |
| ingress_e2e | no | false | Set it true for running e2e tests |
| ingress_e2e_github_repo | no | "" | github repository for running e2e tests |
| ingress_e2e_github_branch | no | master | github repository branch for running e2e tests |
| ingress_go_tarball | no | https://go.dev/dl/go1.22.4.linux-ppc64le.tar.gz | HTTPS URL for golang tarball |
| ingress_github_username | no | "" | Github username |
| ingress_github_token | no | "" | Github token |

Dependencies
------------

- To run e2e test cases, it requires access to the openshift-test-private repository.

Example Playbook
----------------

```
- name: Deploy ingress firewall operator in OpenShift
include_role:
name: ocp-ingress-firewall-operator
```

License
-------

See LICENCE.txt

Author Information
------------------

[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ ingress_e2e: true
ingress_e2e_github_repo: "https://github.com/openshift/openshift-tests-private"
ingress_e2e_github_branch: "master"
ingress_github_username: ""
ingress_github_token: ""
ingress_github_token: ""
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ if [ $re_run_count -ne 0 ]; then
echo -e "\n\ne2e summary after re-running:" >> $INGRESS_WORKDIR/e2e-summary.txt
cat $INGRESS_WORKDIR/failed_tests.txt >> $INGRESS_WORKDIR/e2e-summary.txt
cat "${INGRESS_WORKDIR}/e2e-re-run-output-${re_run_count}.txt" | tail -n 2 >> $INGRESS_WORKDIR/e2e-summary.txt
fi
fi
22 changes: 13 additions & 9 deletions playbooks/roles/ocp-ingress-firewall-operator/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
kind: IngressNodeFirewall
metadata:
name: ingressnodefirewall-zero-trust
namespace: openshift-ingress-node-firewall # Ensure the correct namespace is used
namespace: openshift-ingress-node-firewall
spec:
interfaces:
- eth1
Expand Down Expand Up @@ -244,7 +244,11 @@
register: check_crds
failed_when: check_crds.rc != 0

# e2e test
# Delete the Dual operator group
- name: Delete Ingress Node Firewall OperatorGroup
shell: "oc delete og ingress-node-firewall-operators -n openshift-ingress-node-firewall"

# e2e test for Ingress Firewall Operator
- name: Run e2e test cases
block:
- name: Install dependencies for running e2e tests
Expand All @@ -256,19 +260,19 @@
include_role:
name: golang-installation
vars:
go_tarball: "{{ ingress_go_tarball }}"
golang_path: "/usr/local"
golang_tarball_url: "{{ ingress_go_tarball }}"
golang_installation_path: "/usr/local"

- name: Clone the opeshift-test-private repository
git:
repo: "https://{{ ingress_github_username }}:{{ ingress_github_token }}@github.com{{ ingress_e2e_github_repo | urlsplit('path') }}"
dest: "{{ ingress_directory }}/openshift-tests-private"
version: "{{ ingress_e2e_github_branch }}"

- name: Run make target
make:
- name: Run make target to build
command:
cmd: "make build"
chdir: "{{ ingress_directory }}/openshift-tests-private"
target: build

- name: Generate ingress Operators test cases list
shell: |
Expand All @@ -279,7 +283,7 @@

- name: Run ingress firewall e2e tests
shell: |
./bin/extended-platform-tests run -f tests.txt -o {{ ingress_directory }}/e2e-output.txt
./bin/extended-platform-tests run -f tests.txt -o {{ ingress_directory }}/e2e-output.txt > e2e_logs.txt
args:
chdir: "{{ ingress_directory }}/openshift-tests-private"
ignore_errors: true
Expand All @@ -291,4 +295,4 @@

environment: "{{ ingress_e2e_env }}"
ignore_errors: true
when: ingress_e2e
when: ingress_e2e
4 changes: 2 additions & 2 deletions playbooks/roles/ocp-ingress-firewall-operator/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

# var for playbooks/roles/ocp-ingress-firewall-operator

ingress_e2e_env:
KUBECONFIG: "{{ ansible_env.HOME }}/.kube/config"
COMPLIANCE_WORKDIR: "{{ ingress_directory }}"
INGRESS_WORKDIR: "{{ ingress_directory }}"
PATH: "/usr/local/go/bin:{{ ansible_env.PATH }}"

0 comments on commit 00b56de

Please sign in to comment.