Skip to content

Commit

Permalink
Improve sync options on gitops_repo ApplicationSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndouglas committed Mar 9, 2024
1 parent 2db3fce commit 561fbc9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 49 deletions.
2 changes: 0 additions & 2 deletions roles/goldentooth.install_argocd_apps/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ argocd_default_project_options:
argocd_generic_projects:
- name: 'prometheus-node-exporter'
description: 'Prometheus Node Exporter'
- name: 'httpbin'
description: 'HTTPBin'
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@
destination:
server: https://kubernetes.default.svc
namespace: "{{ '{{' }} .repository {{ '}}' }}"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=true
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true
run_once: true

This file was deleted.

15 changes: 7 additions & 8 deletions roles/goldentooth.install_argocd_apps/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
loop_control:
loop_var: 'project_file'

- name: 'Create Argo CD ApplicationSet resources.'
ansible.builtin.include_tasks: "{{ application_set_file }}"
loop:
- 'application_sets/gitops_repo.yaml'
loop_control:
loop_var: 'application_set_file'

- name: 'Create Argo CD Application resources.'
ansible.builtin.include_tasks: "{{ application_file }}"
loop:
- 'applications/httpbin.yaml'
- 'applications/incubator.yaml'
- 'applications/prometheus_node_exporter.yaml'
loop_control:
loop_var: 'application_file'

- name: 'Create Argo CD ApplicationSet resources.'
ansible.builtin.include_tasks: "{{ application_set_file }}"
loop:
- 'application_sets/gitops_repo.yaml'
loop_control:
loop_var: 'application_set_file'

0 comments on commit 561fbc9

Please sign in to comment.