Skip to content

Commit

Permalink
feat: drop tower support
Browse files Browse the repository at this point in the history
  • Loading branch information
fitbeard committed Feb 9, 2024
1 parent 3b7e7f3 commit ac96061
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Github action for AWX and Ansible Tower resource triggering
# Github action for AWX and Ansible Automation Platform Controller resource triggering

[![main](https://github.com/fitbeard/action-trigger-awx/workflows/main/badge.svg)](https://github.com/fitbeard/action-trigger-awx/actions?query=workflow%3Amain)

This Github action aims to interact with AWX or Tower servers.
This Github action aims to interact with AWX or Ansible Automation Platform Controller.

It connects to an AWX or Tower server and launches a job or workflow_job template or updates project.
It connects to an AWX or Ansible Automation Platform Controller server and launches a job or workflow_job template or updates project.

> **Note**
>
Expand All @@ -23,49 +23,49 @@ See [action.yml](action.yml)
- name: "Test AWX: Simple job template"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test

- name: "Test AWX: Simple job template - specify credentials"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test
credentials: "test-credential"

- name: "Test AWX: Simple workflow template"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: workflow_job_template
resource_name: actions-awxkit-workflow-test

- name: "Test AWX: Project update"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: project
resource_name: ansible-project

- name: "Test AWX: Inventory Source update"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: inventory_source
resource_name: inventory-source-name

- name: "Test AWX: Random options job template 1"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test3
limit: "localhost-0*"
Expand All @@ -75,8 +75,8 @@ See [action.yml](action.yml)
- name: "Test AWX: Random options job template 2"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test3
limit: "localhost-0*"
Expand All @@ -89,8 +89,8 @@ See [action.yml](action.yml)
- name: "Test AWX: Simple job template without waiting"
uses: fitbeard/[email protected]
with:
tower_url: ${{ secrets.TOWER_HOST }}
tower_token: ${{ secrets.TOWER_OAUTH_TOKEN }}
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test2
monitor: "false"
Expand Down
20 changes: 10 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: Trigger AWX and Ansible Tower resources
name: Trigger AWX and Ansible Automation Platform Controller resources
author: Tadas Sutkaitis
description: Trigger resource on AWX or Ansible Tower
description: Trigger resource on AWX or Ansible Automation Platform Controller
branding:
color: red
icon: play-circle
inputs:
tower_url:
description: "AWX or Ansible Tower URL."
controller_host:
description: "AWX or Ansible Automation Platform Controller URL."
required: true
tower_token:
description: "AWX or Ansible Tower Oauth token."
controller_oauth_token:
description: "AWX or Ansible Automation Platform Controller Oauth token."
required: true
tower_verify_ssl:
controller_verify_ssl:
description: "Require valid SSL certificate"
required: false
default: "true"
Expand Down Expand Up @@ -57,9 +57,9 @@ runs:
using: docker
image: Dockerfile
env:
TOWER_HOST: ${{ inputs.tower_url }}
TOWER_OAUTH_TOKEN: ${{ inputs.tower_token }}
TOWER_VERIFY_SSL: ${{ inputs.tower_verify_ssl }}
CONTROLLER_HOST: ${{ inputs.controller_host }}
CONTROLLER_OAUTH_TOKEN: ${{ inputs.controller_oauth_token }}
CONTROLLER_VERIFY_SSL: ${{ inputs.controller_verify_ssl }}
RESOURCE_TYPE: ${{ inputs.resource_type }}
RESOURCE_NAME: ${{ inputs.resource_name }}
JOB_TYPE: ${{ inputs.job_type }}
Expand Down
20 changes: 10 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ set -e

export PYTHONUNBUFFERED=1

if [ -z "$TOWER_HOST" ]; then
echo "Tower host is not set. Exiting."
if [ -z "$CONTROLLER_HOST" ]; then
echo "Controller host is not set. Exiting."
exit 1
fi

if [ -z "$TOWER_OAUTH_TOKEN" ]; then
echo "Tower oauth token is not set. Exiting."
if [ -z "$CONTROLLER_OAUTH_TOKEN" ]; then
echo "Controller oauth token is not set. Exiting."
exit 1
fi

if [ -z "$TOWER_VERIFY_SSL" ]; then
TOWER_VERIFY_SSL="true"
elif [ $TOWER_VERIFY_SSL = "true" ]; then
TOWER_VERIFY_SSL="true"
elif [ $TOWER_VERIFY_SSL = "false" ]; then
TOWER_VERIFY_SSL="false"
if [ -z "$CONTROLLER_VERIFY_SSL" ]; then
CONTROLLER_VERIFY_SSL="true"
elif [ $CONTROLLER_VERIFY_SSL = "true" ]; then
CONTROLLER_VERIFY_SSL="true"
elif [ $CONTROLLER_VERIFY_SSL = "false" ]; then
CONTROLLER_VERIFY_SSL="false"
else
echo "Unknown ssl verify value. Exiting."
exit 1
Expand Down

0 comments on commit ac96061

Please sign in to comment.