File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ inputs:
31
31
sudo :
32
32
description : Set to "true" if root is required for running your playbook
33
33
required : false
34
+ no_color :
35
+ description : Set to "true" if the Ansible output should not include colors (defaults to "false")
36
+ required : false
34
37
outputs :
35
38
output :
36
39
description : The captured output of both stdout and stderr from the Ansible Playbook run
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ async function main() {
15
15
const knownHosts = core . getInput ( "known_hosts" )
16
16
const options = core . getInput ( "options" )
17
17
const sudo = core . getInput ( "sudo" )
18
+ const noColor = core . getInput ( "no_color" )
18
19
19
20
let cmd = [ "ansible-playbook" , playbook ]
20
21
@@ -79,7 +80,11 @@ async function main() {
79
80
cmd . unshift ( "sudo" , "-E" , "env" , `PATH=${ process . env . PATH } ` )
80
81
}
81
82
82
- process . env . ANSIBLE_FORCE_COLOR = "True"
83
+ if ( noColor ) {
84
+ process . env . ANSIBLE_NOCOLOR = "True"
85
+ } else {
86
+ process . env . ANSIBLE_FORCE_COLOR = "True"
87
+ }
83
88
84
89
let output = ""
85
90
await exec . exec ( cmd . join ( ' ' ) , null , {
You can’t perform that action at this time.
0 commit comments