-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (104 loc) · 3.07 KB
/
cd-ansible.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Ansible
# Controls when the workflow will run
on:
workflow_call:
inputs:
ENVIRONMENT:
required: false
type: string
RUNNER:
required: false
default: self-hosted
type: string
AWX_VERIFY_SSL:
description: "Require valid SSL certificate"
required: false
default: "true"
type: string
RESOURCE_TYPE:
description: "One of resource types: project, job_template or workflow_job_template."
required: true
type: string
RESOURCE_NAME:
description: "Name or ID of project, job_template or workflow_job_template."
required: true
type: string
JOB_TYPE:
description: "Run or chek playbook."
required: false
type: string
LIMIT:
description: "Host pattern that will be managed or affected by the playbook."
required: false
type: string
TAGS:
description: "Playbook tags to apply."
required: false
type: string
SKIP_TAGS:
description: "Playbook tags to skip."
required: false
type: string
TIMEOUT:
description: "If set with monitor, time out waiting on job completion."
required: false
type: number
INVENTORY:
description: "Name or ID of the associated inventory."
required: false
type: string
BRANCH:
description: "SCM branch to override."
required: false
type: string
MONITOR:
description: "Monitor job progress in realtime."
required: false
default: "true"
type: string
EXTRA_VARS:
description: "Pass extra command line variables to the playbook."
required: false
type: string
CREDENTIALS:
description: "Name or ID of the associated credentials."
required: false
type: string
secrets:
AWX_HOST:
description: "AWX or Ansible Tower URL."
required: true
AWX_OAUTH_TOKEN:
description: "AWX or Ansible Tower Oauth token."
required: true
jobs:
deploy:
runs-on: ${{ inputs.RUNNER }}
name: Deploy
environment: ${{ inputs.ENVIRONMENT }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout actions
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
path: actions
- uses: ./actions/.github/actions/ansible
name: Trigger AWX
with:
AWX_VERIFY_SSL: ${{ inputs.AWX_VERIFY_SSL}}
RESOURCE_TYPE: ${{ inputs.RESOURCE_TYPE}}
RESOURCE_NAME: ${{ inputs.RESOURCE_NAME}}
LIMIT: ${{ inputs.LIMIT}}
EXTRA_VARS: ${{ inputs.EXTRA_VARS}}
BRANCH: ${{ inputs.BRANCH}}
INVENTORY: ${{ inputs.INVENTORY}}
TAGS: ${{ inputs.TAGS}}
SKIP_TAGS: ${{ inputs.SKIP_TAGS}}
MONITOR: ${{ inputs.MONITOR}}
CREDENTIALS: ${{ inputs.CREDENTIALS }}
env:
AWX_HOST: ${{ secrets.AWX_HOST }}
AWX_OAUTH_TOKEN: ${{ secrets.AWX_OAUTH_TOKEN }}