A repo to hold Ansible runner examples for the Tektoncd Task ansible-runner
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/git-clone/0.1/git-clone.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd-ansible-runner-example/catalog/master/playbooks-pvc.yaml
Run the following Task to clone this repository
tkn task start git-clone \
--workspace=name=output,claimName=ansible-playbooks \
--param=url=https://github.com/kameshsampath/tektoncd-ansible-runner-example \
--param=revision=master \
--param=deleteExisting=true \
--showlog
You need proper RBAC in Kubernetes to allow it to perform the example tasks:
kubectl apply -f https://raw.githubusercontent.com/tektoncd-ansible-runner-example/master/kubernetes/ansible-deployer.yaml
tkn task start ansible-runner \
--serviceaccount ansible-deployer-account \
--param=project-dir=kubernetes \
--param=args='-p list-pods.yml' \
--workspace=name=runner-dir,claimName=ansible-playbooks \
--showlog
tkn task start ansible-runner \
--serviceaccount ansible-deployer-account \
--param=project-dir=kubernetes \
--param=args='-p create-deployment.yml' \
--workspace=name=runner-dir,claimName=ansible-playbooks \
--showlog
tkn task start ansible-runner \
--serviceaccount ansible-deployer-account \
--param=project-dir=kubernetes \
--param=args='-p create-service.yml' \
--workspace=name=runner-dir,claimName=ansible-playbooks \
--showlog