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

Simplify Ansible integration example #107

Merged
merged 1 commit into from
Mar 8, 2022
Merged
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
6 changes: 0 additions & 6 deletions examples/ansible/appsub/00-namespace.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/ansible/appsub/01-placement-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: non-local-cluster
namespace: ansible-pre-post
namespace: default
spec:
# apply to 1 cluster whoevers name not local-cluster
clusterReplicas: 1
Expand Down
9 changes: 9 additions & 0 deletions examples/ansible/appsub/02-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
name: git
namespace: default
spec:
type: git
pathname: https://github.com/open-cluster-management-io/multicloud-operators-subscription.git
11 changes: 6 additions & 5 deletions examples/ansible/appsub/03-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: ansible-hook
namespace: ansible-pre-post
labels:
app: ansible
namespace: default
annotations:
apps.open-cluster-management.io/github-path: examples/ansible/resources
apps.open-cluster-management.io/github-branch: master
apps.open-cluster-management.io/github-branch: main
spec:
channel: ansible-pre-post/git
hooksecretref:
namespace: default
name: toweraccess
channel: default/git
placement:
placementRef:
kind: PlacementRule
Expand Down
16 changes: 0 additions & 16 deletions examples/ansible/appsub/04-application.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions examples/ansible/appsub/EDITE02-channel.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/ansible/appsub/EDITME-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: toweraccess
namespace: ansible-pre-post
namespace: default
type: Opaque
stringData:
token: _token_here
Expand Down
13 changes: 6 additions & 7 deletions examples/ansible/appsub/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Prepare:
1. A open-cluster-management hub cluster with subscription operator running and at least one managed cluster. See https://open-cluster-management.io "Getting Started"
1. An Open Cluster Management hub cluster with subscription operator running and at least one managed cluster with subscription add-on enable. See https://open-cluster-management.io "Get Started" for more details.
2. An Ansible AWX/Tower environment. See https://github.com/ansible/awx for more details.

Perform:
1. Fork the https://github.com/open-cluster-management/multicloud-operators-subscription into your personal repo.
2. Edit the `examples/ansible/appsub/EDITME02-channel.yaml` and `examples/ansible/appsub/EDITME-secret.yaml` files.
3. `git clone https://github.com/_your_github_id_/multicloud-operators-subscription.git`
4. `cd multicloud-operators-subscription`
5. `kubectl apply -f examples/ansible/appsub`
6. This will create a subscription that watches resources in https://github.com/_your_github_id_/multicloud-operators-subscription/examples/ansible/resources
1. Edit the `examples/ansible/appsub/EDITME-secret.yaml` file.
2. `git clone https://github.com/open-cluster-management-io/multicloud-operators-subscription.git`
3. `cd multicloud-operators-subscription`
4. `kubectl apply -f examples/ansible/appsub`
5. This will create a subscription that watches resources in https://github.com/open-cluster-management-io/multicloud-operators-subscription/tree/main/examples/ansible/resources
1 change: 1 addition & 0 deletions examples/ansible/resources/cfg_and_ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
name: guestbook-cfgmap
data:
database: mongodb
2 changes: 1 addition & 1 deletion examples/ansible/resources/posthook/sub_posthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: tower.ansible.com/v1alpha1
kind: AnsibleJob
metadata:
name: posthook-test
namespace: ansible-pre-post
namespace: default
spec:
job_template_name: Demo Job Template
tower_auth_secret: toweraccess
2 changes: 1 addition & 1 deletion examples/ansible/resources/prehook/sub_prehook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: tower.ansible.com/v1alpha1
kind: AnsibleJob
metadata:
name: prehook-test
namespace: ansible-pre-post
namespace: default
spec:
job_template_name: Demo Job Template
tower_auth_secret: toweraccess