apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: ansible-tower-cli labels: app.kubernetes.io/version: "0.1" annotations: tekton.dev/pipelines.minVersion: "0.12.1" tekton.dev/categories: CLI tekton.dev/tags: ansible, cli tekton.dev/displayName: "ansible tower cli" tekton.dev/platforms: "linux/amd64" spec: description: >- Ansible-tower-cli task simplifies starting jobs, workflow jobs, manage users, projects etc. Ansible Tower (formerly ‘AWX’) is a web-based solution that makes Ansible even more easy to use for IT teams of all kinds, It provides the tower-cli(Tower-CLI) command line tool that simplifies the tasks of starting jobs, workflow jobs, manage users, projects etc. params: - name: SSLVERIFY description: Disable tower ssl verification default: "false" type: string - name: ARGS description: The tower-cli commands to tun type: array default: - "--help" - name: HOST description: The Ansible Tower host type: string default: "" - name: tower-secret description: The Ansible Tower secret with credentials type: string default: "tower-creds" steps: - name: config image: quay.io/rcmendes/ansible-tower-cli@sha256:3a61778f410526db8d6e02e87715d58ee770c4a4faf57ac408cb5ec1a025ef2c #tag: latest command: - '/bin/sh' - '-c' args: - |- echo -e "verify_ssl = $(params.SSLVERIFY)\nverbose = true\nhost = $(params.HOST)\nusername = $USER\npassword = $PASS" > ~/.tower_cli.cfg chmod 600 ~/.tower_cli.cfg echo "Generated tower_cli.cfg file" echo "-----------------------------" ls -lah ~/ | grep tower_cli echo "-----------------------------" env: - name: USER valueFrom: secretKeyRef: name: $(params.tower-secret) key: USER - name: PASS valueFrom: secretKeyRef: name: $(params.tower-secret) key: PASS - name: tower-cli image: quay.io/rcmendes/ansible-tower-cli@sha256:3a61778f410526db8d6e02e87715d58ee770c4a4faf57ac408cb5ec1a025ef2c #tag: latest command: ["/usr/bin/tower-cli"] args: - "$(params.ARGS)"