Created
September 2, 2020 18:58
-
-
Save descrepes/ada74fd17d1d145d3a351acf016555b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: argoproj.io/v1alpha1 | |
kind: WorkflowTemplate | |
metadata: | |
name: saltstack | |
namespace: argo | |
spec: | |
templates: | |
- name: highstate | |
inputs: | |
parameters: | |
- name: compound | |
container: | |
imagePullPolicy: "Always" | |
image: geshan/fabric-alpine:latest | |
command: ["fab"] | |
args: ["-H", "myuser@salt", "--", "sudo /usr/bin/salt --show-jid --state-output=changes -C \"{{inputs.parameters.compound}}\" state.highstate queue=True" ] | |
metadata: | |
annotations: | |
vault.hashicorp.com/agent-inject: "true" | |
vault.hashicorp.com/role: "saltstack" | |
vault.hashicorp.com/tls-skip-verify: "true" | |
vault.hashicorp.com/agent-inject-secret-id_rsa: "argo/ssh" | |
vault.hashicorp.com/agent-inject-template-id_rsa: | | |
{{- with secret "argo/ssh" -}} | |
{{ .Data.data.id_rsa}} | |
{{- end -}} | |
vault.hashicorp.com/secret-volume-path-id_rsa: "/home/myuser/.ssh" | |
- name: cloud-create | |
inputs: | |
parameters: | |
- name: profile | |
- name: vms | |
script: | |
imagePullPolicy: "Always" | |
image: geshan/fabric-alpine:latest | |
env: | |
- name: VMS | |
value: "{{inputs.parameters.vms}}" | |
command: ["sh"] | |
source: | | |
fab -H myuser@salt -- sudo /usr/bin/salt-cloud -p {{inputs.parameters.profile}} ${VMS//,/ } -P | |
metadata: | |
annotations: | |
vault.hashicorp.com/agent-inject: "true" | |
vault.hashicorp.com/role: "saltstack" | |
vault.hashicorp.com/tls-skip-verify: "true" | |
vault.hashicorp.com/agent-inject-secret-id_rsa: "argo/ssh" | |
vault.hashicorp.com/agent-inject-template-id_rsa: | | |
{{- with secret "argo/ssh" -}} | |
{{ .Data.data.id_rsa}} | |
{{- end -}} | |
vault.hashicorp.com/secret-volume-path-id_rsa: "/home/myuser/.ssh" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment