-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for OpenShift Object Remove role
- Loading branch information
Showing
8 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
ansible_connection: local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[openshift_api] | ||
localhost | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
- hosts: openshift_api | ||
roles: | ||
- role: openshift/remove-object | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
remove-openshift-object | ||
======================== | ||
|
||
This role is used to remove specific OpenShift object. Role is expected to be run on Ansible Host running within OpenShift cluster, that's a target for object removal | ||
|
||
## Requirements | ||
|
||
- Ansible Host running within targetted OpenShift cluster | ||
|
||
|
||
## Role Variables | ||
|
||
|
||
| Variable | Description | Required | Defaults | | ||
|:---------|:------------|:---------|:---------| | ||
|ocp_object_name|Name of OpenShift object to be removed|yes|| | ||
|ocp_object_kind|Kind of object to be removed|yes|| | ||
|ocp_object_namespace|OpenShift Namespace in which object to be removed resides|yes|| | ||
|ocp_object_api_version|API version used for object|yes|| | ||
|
||
|
||
|
||
|
||
## Example Inventory | ||
|
||
```yaml | ||
--- | ||
ocp_object_name: argo-app-abc | ||
ocp_object_kind: Application | ||
ocp_object_namespace: argocd-apps | ||
ocp_object_api_version: argoproj.io/v1alpha1 | ||
|
||
``` | ||
## Example Playbook | ||
```yaml | ||
--- | ||
|
||
- hosts: openshift-api | ||
roles: | ||
- role: remove-openshift-object | ||
``` | ||
License | ||
------- | ||
Apache License 2.0 | ||
Author Information | ||
------------------ | ||
Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
- import_tasks: remove_object.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Remove OpenShift object | ||
k8s: | ||
state: absent | ||
name: "{{ ocp_object_name }}" | ||
api_version: "{{ ocp_object_api_version }}" | ||
kind: "{{ ocp_object_kind }}" | ||
namespace: "{{ ocp_object_namespace }}" |