diff --git a/ansible/roles/apps/files/local-storage.yaml b/ansible/roles/apps/files/local-storage.yaml new file mode 120000 index 0000000000000000000000000000000000000000..06a8699c2591e1738d4108d7aef02f45bca97e5d --- /dev/null +++ b/ansible/roles/apps/files/local-storage.yaml @@ -0,0 +1 @@ +../../../../flux/local-storage.yaml \ No newline at end of file diff --git a/ansible/roles/apps/tasks/flux.yml b/ansible/roles/apps/tasks/flux.yml index 4138fc5aec1743429496d7733c8ad729e2d2f9b7..7419bab0ab71b625ce3f41bbb8ef60273e260d94 100644 --- a/ansible/roles/apps/tasks/flux.yml +++ b/ansible/roles/apps/tasks/flux.yml @@ -1,5 +1,51 @@ --- +- name: Install helm-operator + tags: + - flux + # Commented version of below shell command: + # helm upgrade + # # Install a new release if it doesn't yet exist. + # --install + # --repo "https://charts.fluxcd.io" + # --namespace oas + # --version 0.3.0 + # --set createCRD=true + # # Reconcile actual helm releases with HelmRelease objects with this + # # interval. + # --set chartsSyncInterval=20m + # # Update HelmRelease objects' status with this interval. + # --set statusUpdateInterval=30s + # # Helm release name + # helm-operator + # # Chart name + # helm-operator + shell: helm upgrade --install --repo "https://charts.fluxcd.io" --namespace oas --version 0.3.0 --set createCRD=true --set chartsSyncInterval=20m --set statusUpdateInterval=30s helm-operator helm-operator +- name: Create Kubernetes secret with local-storage settings + tags: + - config + - flux + - local-storage + vars: + flux: + name: "local-storage-settings" + namespace: "oas" + include_tasks: + file: flux_secret.yml + apply: + tags: + - config + - flux + - local-storage + +- name: Create local-storage HelmResource + tags: + - config + - flux + - local-storage + k8s: + state: present + resource_definition: "{{ lookup('file', 'local-storage.yaml') | from_yaml }}" - name: Install flux tags: @@ -40,28 +86,6 @@ # flux shell: helm upgrade --install --repo "https://charts.fluxcd.io" --namespace oas --version 0.16.0 --set git.url="{{ git_url }}" --set git.branch="{{ git_branch }}" --set git.path="{{ git_path }}" --set git.readonly=true --set registry.excludeImage='*' --set sync.state="secret" --set syncGarbageCollection.enabled=true --set git.pollInterval=1h flux flux -- name: Install helm-operator - tags: - - flux - # Commented version of below shell command: - # helm upgrade - # # Install a new release if it doesn't yet exist. - # --install - # --repo "https://charts.fluxcd.io" - # --namespace oas - # --version 0.3.0 - # --set createCRD=true - # # Reconcile actual helm releases with HelmRelease objects with this - # # interval. - # --set chartsSyncInterval=20m - # # Update HelmRelease objects' status with this interval. - # --set statusUpdateInterval=30s - # # Helm release name - # helm-operator - # # Chart name - # helm-operator - shell: helm upgrade --install --repo "https://charts.fluxcd.io" --namespace oas --version 0.3.0 --set createCRD=true --set chartsSyncInterval=20m --set statusUpdateInterval=30s helm-operator helm-operator - - name: Install fluxctl via snap tags: - flux diff --git a/ansible/roles/apps/tasks/local-storage.yml b/ansible/roles/apps/tasks/local-storage.yml deleted file mode 100644 index 22e9c132505d781c73ca56e5bc273f22e111a090..0000000000000000000000000000000000000000 --- a/ansible/roles/apps/tasks/local-storage.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Create Kubernetes secret with local-storage settings - tags: - - config - - flux - - local-storage - vars: - flux: - name: "local-storage-settings" - namespace: "oas" - include_tasks: - file: flux_secret.yml - apply: - tags: - - config - - flux - - local-storage diff --git a/ansible/roles/apps/tasks/main.yml b/ansible/roles/apps/tasks/main.yml index 8e43e01e196ca08e9aff0ce766acd42ac6a2dbde..814454ecccd35fc1501431b31ea5b8ba42e02302 100644 --- a/ansible/roles/apps/tasks/main.yml +++ b/ansible/roles/apps/tasks/main.yml @@ -1,11 +1,8 @@ --- -- name: Install flux +- name: Install helm operator, local-storage and flux import_tasks: flux.yml -- name: Perform tasks necessary for local-storage - import_tasks: local-storage.yml - - name: Tasks pertaining to cert-manager import_tasks: cert-manager.yml