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
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ repos:
language: python
# for backward compatibility
files: .* # all files
args:
- "--exclude-files"
- "dev/ansible-run/README.md"
32 changes: 31 additions & 1 deletion dev/ansible-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,34 @@ crossplane render examples/claim.yaml \
apis/composition.yaml \
examples/functions.yaml \
--include-function-results
```
```

## RENDER KCL

```bash
kcl run oci://ghcr.io/stuttgart-things/kcl-tekton-pr --tag 0.4.2 -D params='{
"oxr": {
"spec": {
"pipelineRunName": "run-ansible-test1",
"namespace": "tekton-ci",
"ansibleCredentialsSecretName": "ansible-credentials",
"ansiblePlaybooks": [
"sthings.baseos.setup"
],
"ansibleVarsFile": [
"manage_filesystem+-true",
"update_packages+-true",
"ansible_become+-true",
"ansible_become_method+-sudo"
],
"ansibleVarsInventory": [
"all+[\"10.31.102.107\"]"
],
"wrapInCrossplane": true,
"crossplaneObjectName": "run-ansible-test",
"crossplaneNamespace": "default",
"crossplaneProviderConfig": "dev"
}
}
}' --format yaml
```
4 changes: 2 additions & 2 deletions dev/ansible-run/apis/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
pipeline:
- step: create-ansiblerun
functionRef:
name: function-kcl
name: crossplane-contrib-function-kcl
input:
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLInput
Expand All @@ -23,4 +23,4 @@ spec:
source: oci://ghcr.io/stuttgart-things/kcl-tekton-pr:0.4.1
- step: automatically-detect-ready-composed-resources
functionRef:
name: function-auto-ready
name: crossplane-contrib-function-auto-ready
4 changes: 2 additions & 2 deletions dev/ansible-run/apis/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ spec:
description: Whether to validate the inventory
default: "true"
enum: ["true", "false"]

# Git Configuration
gitRepoUrl:
type: string
description: Git repository URL
default: https://github.com/stuttgart-things/stage-time.git
gitRevision:
type: string
description: Git branch or revision
Expand Down Expand Up @@ -159,4 +159,4 @@ spec:
- pipelineRunName
- namespace
- gitRepoUrl
- ansiblePlaybooks
- ansiblePlaybooks
26 changes: 26 additions & 0 deletions dev/ansible-run/examples/claim-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: resources.stuttgart-things.com/v1alpha1
kind: AnsibleRun
metadata:
name: run-ansible-test1
namespace: default
spec:
# CROSSPLANE CONFIGURATION
wrapInCrossplane: true
crossplaneObjectName: run-ansible-test-xplane
crossplaneNamespace: default
crossplaneProviderConfig: dev
# PIPELINRUN CONFIGURATION
pipelineRunName: run-ansible-xplane
namespace: tekton-ci
# ANSIBLE CONFIGURATION
ansibleCredentialsSecretName: ansible-credentials
ansiblePlaybooks:
- sthings.baseos.setup
ansibleVarsFile:
- manage_filesystem+-true
- update_packages+-true
- ansible_become+-true
- ansible_become_method+-sudo
ansibleVarsInventory:
- all+["10.31.102.107"]
8 changes: 4 additions & 4 deletions dev/ansible-run/examples/claim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ spec:
gitWorkspaceSubdirectory: /ansible/workdir/

# Credentials
ansibleCredentialsSecretName: ansible-credentials
ansibleCredentialsUserKey: ANSIBLE_USER
ansibleCredentialsPasswordKey: ANSIBLE_PASSWORD
ansibleCredentialsSecretName: ansible-credentials # pragma: allowlist secret
ansibleCredentialsUserKey: ANSIBLE_USER # pragma: allowlist secret
ansibleCredentialsPasswordKey: ANSIBLE_PASSWORD # pragma: allowlist secret

# Ansible Roles and Collections
installExtraRoles: "true"
Expand Down Expand Up @@ -58,4 +58,4 @@ spec:
crossplaneObjectName: ansible-pipeline-test-6
crossplaneNamespace: default
crossplaneProviderConfig: kubernetes-provider
crossplaneTimeout: "60"
crossplaneTimeout: "60"