Skip to content

Commit eafdc03

Browse files
author
Alan Christie
committed
- Doc tweak
1 parent dc804d4 commit eafdc03

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ A GitHub Action that triggers execution of a named template on an [AWX] server.
33
In addition to running the template you can inject a value for a template
44
variable. If unused, the variable `image_tag` is set to the value `latest`.
55

6+
This action essentially allows you to run templates in a remote
7+
AWX server, given a template name, and template user credentials.
8+
69
This action is typically used after you've built and published a container
710
image, and you then want to trigger an AWX template that would deploy that
811
image, say to a Kubernetes cluster.
@@ -28,13 +31,38 @@ A template variable, default `image_tag`
2831
A value for the template variable, default `latest`
2932

3033
## Example usage
34+
Here we trigger the AWX template **My Template**, expected to be
35+
on the server **https://example.com**. The user must have **Execute**
36+
permissions for the chosen template.
37+
38+
```yaml
39+
uses: informaticsmatters/trigger-awx-action@v1
40+
with:
41+
template: My Template
42+
template-host: https://example.com
43+
template-user: ${{ secrets.AWX_USER }}
44+
template-user-password: ${{ secrets.AWX_USER_PASSWORD }}
45+
```
46+
47+
You can also define the value of a template variable. For example,
48+
here we set the variable `ma_image_tag` to `latest` when triggering
49+
**My Template**: -
50+
3151
```yaml
3252
uses: informaticsmatters/trigger-awx-action@v1
3353
with:
3454
template: My Template
3555
template-host: https://example.com
36-
template-user: ${{ secrets.AWX_TEMPLATE_USER }}
37-
template-user-password: ${{ secrets.AWX_TEMPLATE_USER_PASSWORD }}
56+
template-user: ${{ secrets.AWX_USER }}
57+
template-user-password: ${{ secrets.AWX_USER_PASSWORD }}
58+
template-var: ma_image_tag
59+
template-var-value: latest
3860
```
3961

62+
As AWX might be considered an **Environment** you'd typically store your
63+
secrets in a GitHub **Environment** rather than use **Repository** or
64+
**Organisation** secrets.
65+
66+
---
67+
4068
[awx]: https://github.com/ansible/awx

0 commit comments

Comments
 (0)