Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# These are the validation we disable atm
VALIDATE_GIT_COMMITLINT: false
VALIDATE_JSON_PRETTIER: false
VALIDATE_KUBERNETES_KUBECONFORM: false
VALIDATE_MARKDOWN: false
Expand All @@ -41,7 +42,6 @@ jobs:
VALIDATE_NATURAL_LANGUAGE: false
VALIDATE_SPELL_CODESPELL: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_PYINK: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_PYTHON_RUFF_FORMAT: false
VALIDATE_SHELL_SHFMT: false
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ description: A Helm chart to install an ansible-automation-platform instance
keywords:
- pattern
name: ansible-automation-platform-instance
version: 0.1.1
version: 0.1.2
dependencies:
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ helm-docs: ## Generates README.md from values.yaml
test: helm-lint helm-unittest ## Runs helm lint and unit tests

.PHONY: super-linter
super-linter: ## Runs super linter locally
super-linter: ## Runs super linter locally (mirrors .github/workflows/superlinter.yml)
rm -rf .mypy_cache
podman run -e RUN_LOCAL=true -e USE_FIND_ALGORITHM=true \
podman run -e RUN_LOCAL=true -e USE_FIND_ALGORITHM=true \
-e VALIDATE_GIT_COMMITLINT=false \
-e VALIDATE_JSON_PRETTIER=false \
-e VALIDATE_KUBERNETES_KUBECONFORM=false \
-e VALIDATE_MARKDOWN=false \
Expand All @@ -49,11 +50,10 @@ super-linter: ## Runs super linter locally
-e VALIDATE_NATURAL_LANGUAGE=false \
-e VALIDATE_SPELL_CODESPELL=false \
-e VALIDATE_PYTHON_BLACK=false \
-e VALIDATE_PYTHON_PYINK=false \
-e VALIDATE_PYTHON_PYLINT=false \
-e VALIDATE_PYTHON_RUFF_FORMAT=false \
-e VALIDATE_SHELL_SHFMT=false \
-e VALIDATE_TRIVY=false \
-v $(PWD):/tmp/lint:rw,z \
-w /tmp/lint \
ghcr.io/super-linter/super-linter:slim-v8
ghcr.io/super-linter/super-linter:slim-v8.6.0
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
# ansible-automation-platform-instance

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square)
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square)

A Helm chart to install an ansible-automation-platform instance

This chart is used to set up the Ansible Automation Platform Operator version 2.5.

Automation hub is optional and disabled by default.

When automation hub is enabled, content storage uses the ReadWriteMany CephFS
storage class created by the validated patterns OpenShift Data Foundations chart
(`ocs-storagecluster-cephfs`). Redis and hub PostgreSQL use
`ocs-storagecluster-ceph-rbd` from that same chart. Install the OpenShift Data
Foundations chart in the cluster before enabling hub.

Releases before 2.5 deploy hub as a standalone `AutomationHub` resource.
Releases from 2.5 onward configure hub on the `AnsibleAutomationPlatform` resource.

Automation orchestrator is installed by the automation-orchestrator chart, with
its PostgreSQL cluster installed by the cloudnative-pg chart.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| aap.eda_disabled | bool | `false` | |
| aap.hub_disabled | bool | `true` | |
| aap.lightspeed_disabled | bool | `true` | |
| eePullSecret.key | string | `"secret/data/hub/ee-pull-secret"` | |
| eePullSecret.manage | bool | `false` | |
| global.hubClusterDomain | string | `"example.com"` | |
| secretStore.kind | string | `"ClusterSecretStore"` | |
| secretStore.name | string | `"vault-backend"` | |
| aap.eda_disabled | bool | `false` | Disable Event-Driven Ansible. |
| aap.hub_disabled | bool | `true` | Disable automation hub. Enable hub only when the validated patterns OpenShift Data Foundations chart is installed in the same cluster. |
| aap.lightspeed_disabled | bool | `true` | Disable Ansible Lightspeed. |
| aap.release | string | `"2.5"` | Ansible Automation Platform release. Releases before 2.5 deploy automation hub as a standalone AutomationHub resource. |
| eePullSecret.key | string | `"secret/data/hub/ee-pull-secret"` | Vault path passed to the ExternalSecret extract key. |
| eePullSecret.manage | bool | `false` | Create an ExternalSecret for the automation controller execution environment pull secret. |
| global.hubClusterDomain | string | `"example.com"` | Domain used in the OpenShift console link for the platform route. |
| hub.fileStorageAccessMode | string | `"ReadWriteMany"` | Access mode for automation hub content. CephFS from the OpenShift Data Foundations chart provides ReadWriteMany. |
| hub.fileStorageSize | string | `"100Gi"` | Size of the automation hub content volume. |
| hub.fileStorageStorageClass | string | `"ocs-storagecluster-cephfs"` | Storage class for automation hub content. Created by the OpenShift Data Foundations chart. |
| hub.postgresStorageClass | string | `"ocs-storagecluster-ceph-rbd"` | Storage class for the automation hub PostgreSQL volume. Created by the OpenShift Data Foundations chart. |
| hub.redisStorageClass | string | `"ocs-storagecluster-ceph-rbd"` | Storage class for the automation hub Redis volume. Created by the OpenShift Data Foundations chart. |
| hub.redisStorageSize | string | `"10Gi"` | Size of the automation hub Redis volume. |
| hub.storageType | string | `"file"` | Automation hub content backend. file uses the CephFS ReadWriteMany class from the OpenShift Data Foundations chart. |
| secretStore.kind | string | `"ClusterSecretStore"` | External Secrets store kind. |
| secretStore.name | string | `"vault-backend"` | External Secrets store used when eePullSecret.manage is true. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
14 changes: 14 additions & 0 deletions README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@

This chart is used to set up the Ansible Automation Platform Operator version 2.5.

Automation hub is optional and disabled by default.

When automation hub is enabled, content storage uses the ReadWriteMany CephFS
storage class created by the validated patterns OpenShift Data Foundations chart
(`ocs-storagecluster-cephfs`). Redis and hub PostgreSQL use
`ocs-storagecluster-ceph-rbd` from that same chart. Install the OpenShift Data
Foundations chart in the cluster before enabling hub.

Releases before 2.5 deploy hub as a standalone `AutomationHub` resource.
Releases from 2.5 onward configure hub on the `AnsibleAutomationPlatform` resource.

Automation orchestrator is installed by the automation-orchestrator chart, with
its PostgreSQL cluster installed by the cloudnative-pg chart.

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}
Expand Down
15 changes: 15 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{/*
Hub content, Redis, and PostgreSQL storage for the validated patterns
OpenShift Data Foundations chart. That chart creates:
ocs-storagecluster-cephfs ReadWriteMany filesystem (hub content)
ocs-storagecluster-ceph-rbd ReadWriteOnce block (Redis and hub PostgreSQL)
*/}}
{{- define "aap.hubStorage" -}}
storage_type: {{ .Values.hub.storageType }}
file_storage_access_mode: {{ .Values.hub.fileStorageAccessMode }}
file_storage_size: {{ .Values.hub.fileStorageSize }}
file_storage_storage_class: {{ .Values.hub.fileStorageStorageClass }}
redis_storage_class: {{ .Values.hub.redisStorageClass }}
redis_storage_size: {{ .Values.hub.redisStorageSize }}
postgres_storage_class: {{ .Values.hub.postgresStorageClass }}
{{- end -}}
7 changes: 6 additions & 1 deletion templates/aap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ spec:
disabled: false
eda:
disabled: {{ coalesce .Values.aap.eda_disabled "false" }}
{{- if semverCompare ">=2.5.0" (toString .Values.aap.release) }}
hub:
disabled: {{ coalesce .Values.aap.hub_disabled "false" }}
disabled: {{ .Values.aap.hub_disabled }}
{{- if not .Values.aap.hub_disabled }}
{{- include "aap.hubStorage" . | nindent 4 }}
{{- end }}
{{- end }}
lightspeed:
disabled: {{ coalesce .Values.aap.lightspeed_disabled "false" }}
10 changes: 10 additions & 0 deletions templates/automationhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if and (not .Values.aap.hub_disabled) (semverCompare "<2.5.0" (toString .Values.aap.release)) }}
---
apiVersion: automationhub.ansible.com/v1beta1
kind: AutomationHub
metadata:
name: hub
namespace: ansible-automation-platform
spec:
{{- include "aap.hubStorage" . | nindent 2 }}
{{- end }}
131 changes: 131 additions & 0 deletions tests/aap_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
suite: ansible automation platform instance
templates:
- aap.yaml
tests:
- it: disables hub by default
asserts:
- hasDocuments:
count: 1
- isKind:
of: AnsibleAutomationPlatform
- equal:
path: spec.hub.disabled
value: true
- notExists:
path: spec.hub.storage_type
- notExists:
path: spec.hub.file_storage_storage_class
- it: configures hub on the platform resource for release 2.5
set:
aap.hub_disabled: false
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.hub.disabled
value: false
- equal:
path: spec.hub.storage_type
value: file
- equal:
path: spec.hub.file_storage_access_mode
value: ReadWriteMany
- equal:
path: spec.hub.file_storage_size
value: 100Gi
- equal:
path: spec.hub.file_storage_storage_class
value: ocs-storagecluster-cephfs
- equal:
path: spec.hub.redis_storage_class
value: ocs-storagecluster-ceph-rbd
- equal:
path: spec.hub.redis_storage_size
value: 10Gi
- equal:
path: spec.hub.postgres_storage_class
value: ocs-storagecluster-ceph-rbd
- it: honors hub storage overrides
set:
aap.hub_disabled: false
hub.fileStorageStorageClass: custom-cephfs
hub.fileStorageSize: 200Gi
hub.redisStorageClass: custom-rbd
asserts:
- equal:
path: spec.hub.file_storage_storage_class
value: custom-cephfs
- equal:
path: spec.hub.file_storage_size
value: 200Gi
- equal:
path: spec.hub.redis_storage_class
value: custom-rbd
- it: omits nested hub on releases before 2.5
set:
aap.release: "2.4"
aap.hub_disabled: false
asserts:
- hasDocuments:
count: 1
- isKind:
of: AnsibleAutomationPlatform
- notExists:
path: spec.hub
---
suite: standalone automation hub
templates:
- automationhub.yaml
tests:
- it: does not render hub by default
asserts:
- hasDocuments:
count: 0
- it: does not render hub for release 2.5 when hub is enabled
set:
aap.hub_disabled: false
asserts:
- hasDocuments:
count: 0
- it: deploys a standalone AutomationHub on releases before 2.5
set:
aap.release: "2.4"
aap.hub_disabled: false
asserts:
- hasDocuments:
count: 1
- isKind:
of: AutomationHub
- equal:
path: metadata.name
value: hub
- equal:
path: spec.storage_type
value: file
- equal:
path: spec.file_storage_access_mode
value: ReadWriteMany
- equal:
path: spec.file_storage_storage_class
value: ocs-storagecluster-cephfs
- equal:
path: spec.redis_storage_class
value: ocs-storagecluster-ceph-rbd
- equal:
path: spec.postgres_storage_class
value: ocs-storagecluster-ceph-rbd
- it: skips standalone hub when hub is disabled on an older release
set:
aap.release: "2.4"
asserts:
- hasDocuments:
count: 0
- it: accepts an unquoted release number
set:
aap.release: 2.4
aap.hub_disabled: false
asserts:
- hasDocuments:
count: 1
- isKind:
of: AutomationHub
28 changes: 28 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
---
global:
# -- Domain used in the OpenShift console link for the platform route.
hubClusterDomain: example.com

eePullSecret:
# -- Create an ExternalSecret for the automation controller execution environment pull secret.
manage: false
# -- Vault path passed to the ExternalSecret extract key.
key: secret/data/hub/ee-pull-secret

aap:
# -- Ansible Automation Platform release. Releases before 2.5 deploy automation hub as a standalone AutomationHub resource.
release: "2.5"
# -- Disable Event-Driven Ansible.
eda_disabled: false
# -- Disable automation hub. Enable hub only when the validated patterns OpenShift Data Foundations chart is installed in the same cluster.
hub_disabled: true
# -- Disable Ansible Lightspeed.
lightspeed_disabled: true

# Storage defaults match the storage classes created by the validated patterns
# OpenShift Data Foundations chart (ocs-storagecluster-cephfs and ocs-storagecluster-ceph-rbd).
hub:
# -- Automation hub content backend. file uses the CephFS ReadWriteMany class from the OpenShift Data Foundations chart.
storageType: file
# -- Access mode for automation hub content. CephFS from the OpenShift Data Foundations chart provides ReadWriteMany.
fileStorageAccessMode: ReadWriteMany
# -- Size of the automation hub content volume.
fileStorageSize: 100Gi
# -- Storage class for automation hub content. Created by the OpenShift Data Foundations chart.
fileStorageStorageClass: ocs-storagecluster-cephfs
# -- Storage class for the automation hub Redis volume. Created by the OpenShift Data Foundations chart.
redisStorageClass: ocs-storagecluster-ceph-rbd
# -- Size of the automation hub Redis volume.
redisStorageSize: 10Gi
# -- Storage class for the automation hub PostgreSQL volume. Created by the OpenShift Data Foundations chart.
postgresStorageClass: ocs-storagecluster-ceph-rbd

secretStore:
# -- External Secrets store used when eePullSecret.manage is true.
name: vault-backend
# -- External Secrets store kind.
kind: ClusterSecretStore
Loading