|
| 1 | +--- |
| 2 | +apiVersion: tekton.dev/v1 |
| 3 | +kind: Pipeline |
| 4 | +metadata: |
| 5 | + name: "ansible" |
| 6 | +spec: |
| 7 | + description: "This pipeline clones a github repo, builds it and uploads assets." |
| 8 | + params: |
| 9 | + - name: "ansible-repo-clone-url" |
| 10 | + type: "string" |
| 11 | + description: "URL of the Ansible repo to clone" |
| 12 | + - name: "ansible-inventory-repo-clone-url" |
| 13 | + type: "string" |
| 14 | + description: "URL of the Ansible inventory repo to clone" |
| 15 | + - name: "revision" |
| 16 | + type: "string" |
| 17 | + default: "" |
| 18 | + - description: "Endpoint of Vault API" |
| 19 | + name: "vault-address" |
| 20 | + type: "string" |
| 21 | + - description: "Vault SSH role" |
| 22 | + name: "vault-ssh-role" |
| 23 | + type: "string" |
| 24 | + - description: "Vault SSH mount" |
| 25 | + name: "vault-ssh-mount" |
| 26 | + type: "string" |
| 27 | + - description: "Vault Kubernetes auth role" |
| 28 | + name: "vault-kubernetes-auth-role" |
| 29 | + type: "string" |
| 30 | + - description: "Vault Kubernetes auth mount" |
| 31 | + name: "vault-kubernetes-auth-mount" |
| 32 | + type: "string" |
| 33 | + workspaces: |
| 34 | + - name: "shared-data" |
| 35 | + description: "This workspace contains the cloned repo files, so they can be read by the next task." |
| 36 | + - name: "ssh-creds" |
| 37 | + description: "Workspace containing the SSH keys to clone from GitHub" |
| 38 | + tasks: |
| 39 | + - name: "git-clone-ansible" |
| 40 | + taskRef: |
| 41 | + name: "git-clone" |
| 42 | + workspaces: |
| 43 | + - name: "output" |
| 44 | + workspace: "shared-data" |
| 45 | + params: |
| 46 | + - name: "url" |
| 47 | + value: $(params.ansible-repo-clone-url) |
| 48 | + - name: "revision" |
| 49 | + value: $(params.revision) |
| 50 | + - name: "subdirectory" |
| 51 | + value: "ansible" |
| 52 | + - name: "git-clone-ansible-inventory" |
| 53 | + taskRef: |
| 54 | + name: "git-clone" |
| 55 | + workspaces: |
| 56 | + - name: "output" |
| 57 | + workspace: "shared-data" |
| 58 | + - name: "ssh-directory" |
| 59 | + workspace: "ssh-creds" |
| 60 | + params: |
| 61 | + - name: "url" |
| 62 | + value: $(params.ansible-inventory-repo-clone-url) |
| 63 | + - name: "revision" |
| 64 | + value: $(params.revision) |
| 65 | + - name: "subdirectory" |
| 66 | + value: "inventory" |
| 67 | + - name: "ssh-key-generate" |
| 68 | + taskRef: |
| 69 | + name: "ssh-key-generate" |
| 70 | + workspaces: |
| 71 | + - name: "keypair" |
| 72 | + workspace: "shared-data" |
| 73 | + - name: "ssh-key-sign" |
| 74 | + runAfter: ["ssh-key-generate"] |
| 75 | + taskRef: |
| 76 | + name: "ssh-key-sign" |
| 77 | + workspaces: |
| 78 | + - name: "keypair" |
| 79 | + workspace: "shared-data" |
| 80 | + params: |
| 81 | + - name: "vault-address" |
| 82 | + value: $(params.vault-address) |
| 83 | + - name: "vault-ssh-role" |
| 84 | + value: $(params.vault-ssh-role) |
| 85 | + - name: "vault-ssh-mount" |
| 86 | + value: $(params.vault-ssh-mount) |
| 87 | + - name: "vault-kubernetes-auth-role" |
| 88 | + value: $(params.vault-kubernetes-auth-role) |
| 89 | + - name: "vault-kubernetes-auth-mount" |
| 90 | + value: $(params.vault-kubernetes-auth-mount) |
| 91 | + - name: "ansible-run-playbook" |
| 92 | + runAfter: ["git-clone-ansible", "git-clone-ansible-inventory", "ssh-key-sign"] |
| 93 | + taskRef: |
| 94 | + name: "ansible-run-playbook" |
| 95 | + workspaces: |
| 96 | + - name: "source" |
| 97 | + workspace: "shared-data" |
| 98 | + - name: "keypair" |
| 99 | + workspace: "shared-data" |
0 commit comments