Fix typo;Fix readycheck;Add argocd applicationset
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-08-28 20:10:08 +02:00
parent bd0b74ba19
commit 2cd2c4c6d0
5 changed files with 47 additions and 6 deletions

View File

@ -37,7 +37,7 @@
- name: Ensure gitea API availability - name: Ensure gitea API availability
ansible.builtin.uri: ansible.builtin.uri:
url: https://git.{{ vapp['metacluster.fqdn'] }}/api/healtz url: https://git.{{ vapp['metacluster.fqdn'] }}/api/healthz
method: GET method: GET
register: api_readycheck register: api_readycheck
until: api_readycheck.json.status | default(false) | bool until: api_readycheck.json.status | default(false) | bool

View File

@ -29,9 +29,6 @@
password: "{{ vapp['guestinfo.rootpw'] }}" password: "{{ vapp['guestinfo.rootpw'] }}"
register: argocd_api_token register: argocd_api_token
# - name: Create umbrella application
# ansible.builtin.template:
#
- name: Configure metacluster-gitops repository - name: Configure metacluster-gitops repository
ansible.builtin.template: ansible.builtin.template:
src: gitrepo.j2 src: gitrepo.j2
@ -48,6 +45,20 @@
notify: notify:
- Apply manifests - Apply manifests
- name: Create applicationset
ansible.builtin.template:
src: applicationset.j2
dest: /var/lib/rancher/k3s/server/manifests/{{ _template.name }}-manifest.yaml
owner: root
group: root
mode: 0600
vars:
_template:
name: argocd-applicationset-metacluster
namespace: argo-cd
notify:
- Apply manifests
- name: Trigger handlers - name: Trigger handlers
ansible.builtin.meta: flush_handlers ansible.builtin.meta: flush_handlers

View File

@ -15,8 +15,10 @@
ansible.builtin.uri: ansible.builtin.uri:
url: https://{{ vapp['guestinfo.ipaddress'] }}:6443/livez?verbose url: https://{{ vapp['guestinfo.ipaddress'] }}:6443/livez?verbose
method: GET method: GET
validate_certs: no
status_code: [200, 401]
register: api_readycheck register: api_readycheck
until: api_readycheck.json.apiVersion | default(false) | bool until: api_readycheck.json.apiVersion is defined
retries: 3 retries: 3
delay: 30 delay: 30

View File

@ -0,0 +1,28 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: {{ _template.name }}
namespace: {{ _template.namespace }}
spec:
generators:
- git:
repoURL: https://git.{{ vapp['metacluster.fqdn'] }}/mc/ArgoCD.Config.git
revision: HEAD
directories:
- path: metacluster-applicationset/*
template:
metadata:
name: {% raw %}'{{ path.basename }}'{% endraw %}
spec:
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
source:
repoURL: https://git.{{ vapp['metacluster.fqdn'] }}/mc/ArgoCD.Config.git
targetRevision: HEAD
path: {% raw %}'{{ path }}'{% endraw %}
destination:
server: https://{{ vapp['guestinfo.ipaddress'] }}:6443
namespace: default

View File

@ -112,7 +112,7 @@ components:
gitea: gitea:
helm: helm:
version: v5.0.9 # (= Gitea v1.16.8) version: v6.0.0 # (= Gitea v1.17.1)
chart: gitea-charts/gitea chart: gitea-charts/gitea
parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | sed '/:/!s/$/:latest/' parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | sed '/:/!s/$/:latest/'
chart_values: !unsafe | chart_values: !unsafe |