Skip to content

Commit

Permalink
Deploy user bootstrap application
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunn1 committed Oct 7, 2023
1 parent 417a1f7 commit ca55446
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bootstrap/ansible/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@
- files/applications/pipelines-operator.yaml
- files/applications/web-terminal-operator.yaml

# - name: Load bootstrap application
# set_fact:
# bootstrap: "{{ lookup('url', 'https://raw.githubusercontent.com/coolstore-demo/coolstore/main/bootstrap/argo/base/bootstrap.yaml', split_lines=False) }}"

# - name: Create bootstrap application
# k8s:
# state: present
# definition: "{{ bootstrap }}"
# Todo: Check health of apps
- name: Wait 30 seconds for deployment

- name: Update users applicationset
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'user-appset.yaml.j2') }}"
35 changes: 35 additions & 0 deletions bootstrap/ansible/templates/user-appset.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: users
namespace: openshift-gitops
spec:
generators:
- list:
elements:
{% for n in range(1, users | int + 1 ) %}
- user: {{ n }}
{% endfor %}
template:
metadata:
name: "user{{ user }}"
namespace: openshift-gitops
spec:
destination:
namespace: "user{{user}}-tools"
server: 'https://kubernetes.default.svc'
project: default
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: false
selfHeal: false
source:
repoURL: https://github.com/OpenShiftDemos/argo-rollouts-workshop
targetRevision: main
path: bootstrap/user
helm:
values: |
user: {{ user }}

0 comments on commit ca55446

Please sign in to comment.