-
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.
- Loading branch information
Showing
15 changed files
with
81 additions
and
78 deletions.
There are no files selected for viewing
File renamed without changes.
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,5 @@ | ||
--- | ||
|
||
- hosts: openshift_api | ||
roles: | ||
- role: openshift/manage-objects-via-oc |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
manage-objects-via-api | ||
======================== | ||
|
||
This role is used to manage OpenShift objects via OpenShift API. Role is expected to be run on Ansible Host running within OpenShift cluster, that's a target for object management | ||
|
||
## Requirements | ||
|
||
- Ansible Host running within targetted OpenShift cluster | ||
|
||
|
||
## Role Variables | ||
|
||
|
||
| Variable | Description | Required | Defaults | | ||
|:---------|:------------|:---------|:---------| | ||
|openshift_manage_objects.name|Name of OpenShift object to be processed|yes|| | ||
|openshift_manage_objects.kind|Kind of object to be processed|yes|| | ||
|openshift_manage_objects.namespace|OpenShift Namespace in which object to be processed resides|yes|| | ||
|openshift_manage_objects.api_version|API version used for object|yes|| | ||
|openshift_manage_objects.state|Desired state of OpenShift object|no|"present"| | ||
|
||
|
||
## Example Inventory | ||
|
||
```yaml | ||
--- | ||
openshift_manage_objects: | ||
- name: argo-app-abc | ||
kind: Application | ||
namespace: argocd-apps | ||
api_version: argoproj.io/v1alpha1 | ||
state: absent | ||
``` | ||
## Example Playbook | ||
```yaml | ||
--- | ||
|
||
- hosts: openshift-api | ||
roles: | ||
- role: manage-openshift-objects-via-api | ||
``` | ||
License | ||
------- | ||
Apache License 2.0 | ||
Author Information | ||
------------------ | ||
Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs. |
File renamed without changes.
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: manage_objects.yml |
File renamed without changes.
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
File renamed without changes.
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: manage_objects.yml |
5 changes: 5 additions & 0 deletions
5
roles/openshift/manage-objects-via-oc/tasks/manage_objects.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,5 @@ | ||
--- | ||
- name: Manage OpenShift objects with OC | ||
shell: | ||
cmd: "oc {{ item.action }} {{ item.kind }}/{{ item.name }} -n {{ item.namespace }}" | ||
loop: "{{ openshift_manage_objects }}" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.