Skip to content

Commit 35b8b38

Browse files
committed
syncing changes
1 parent aecddb5 commit 35b8b38

File tree

3 files changed

+49
-32
lines changed

3 files changed

+49
-32
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@ on:
22
push:
33
workflow_dispatch:
44
inputs:
5-
logLevel:
6-
description: 'Log level'
5+
validate_certs:
6+
description: 'Use SSL? (validate_certs)'
77
required: true
8-
default: 'warning'
8+
default: false
99
type: choice
1010
options:
11-
- info
12-
- warning
13-
- debug
14-
print_tags:
15-
description: 'True to print to STDOUT'
16-
required: true
17-
type: boolean
18-
tags:
19-
description: 'Test scenario tags'
11+
- true
12+
- false
13+
job_template:
14+
description: 'The Job Template name you want to launch'
2015
required: true
2116
type: string
2217

@@ -26,10 +21,8 @@ jobs:
2621
name: A job to say hello
2722
steps:
2823
- name: Hello world action step
29-
id: hello
24+
id: controller
3025
uses: ansible-cloud/[email protected]
31-
with:
32-
who-to-greet: 'Mona the Octocat'
3326
# Use the output from the `hello` step
34-
- name: Get the output time
35-
run: echo "The time was ${{ steps.hello.outputs.time }}"
27+
- name: The job template being executed
28+
run: echo "The job template is ${{ steps.controller.inputs.job_template }}"

action.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
# action.yml
2-
name: 'Hello World'
3-
description: 'Greet someone and record the time'
2+
name: 'AAP Automation Controller Action'
3+
branding:
4+
icon: 'arrow-right-circle'
5+
color: 'red'
6+
description: 'Launch Job Templates or Workflow Template and retrieve information from job output'
47
inputs:
5-
who-to-greet: # id of input
6-
description: 'Who to greet'
8+
controller_host:
9+
description: "Automation controller URL."
710
required: true
8-
default: 'World'
9-
outputs:
10-
time: # id of output
11-
description: 'The time we greeted you'
11+
controller_host:
12+
description: "Automation controller username."
13+
required: false
14+
controller_password:
15+
description: "Automation controller password."
16+
required: false
17+
validate_certs:
18+
required: false
19+
default: "true"
20+
job_template:
21+
description: "Name or ID of project, job_template or workflow_job_template."
22+
required: true
23+
extra_vars:
24+
description: "Pass extra command line variables to the playbook."
25+
required: false
1226
runs:
13-
using: 'docker'
14-
image: 'Dockerfile'
27+
using: docker
28+
image: Dockerfile
1529
args:
16-
- ${{ inputs.who-to-greet }}
30+
- ${{ inputs.job_template }}
31+
- ${{ inputs.extra_vars }}
32+
env:
33+
CONTROLLER_HOST: ${{ inputs.controller_host }}
34+
CONTROLLER_USERNAME: ${{ inputs.controller_username }}
35+
CONTROLLER_PASSWORD: ${{ inputs.controller_password }}
36+
CONTROLLER_VERIFY_SSL: ${{ inputs.validate_certs }}

entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#! /usr/bin/env bash
22

3-
echo "hello"
3+
echo "AAP - Automation controller Github Action"
44

5-
echo "Hello $1"
6-
time=$(date)
7-
echo "::set-output name=time::$time"
5+
if [ -z "$CONTROLLER_HOST" ]; then
6+
echo "Automation controller host is not set. Exiting."
7+
exit 1
8+
fi
9+
10+
11+
echo "END OF AAP - Automation controller Github Action"

0 commit comments

Comments
 (0)