diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 0eabb4593c..cb60781b98 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -56,6 +56,15 @@ ANSIBLE_NOCOWS: - {key: nocows, section: defaults} type: boolean yaml: {key: display.i_am_no_fun} +ANSIBLE_COWPATH: + name: Set path to cowsay command + default: null + description: Specify a custom cowsay path or swap in your cowsay implementation of choice + env: [{name: ANSIBLE_COWPATH}] + ini: + - {key: cowpath, section: defaults} + type: string + yaml: {key: display.cowpath} ANSIBLE_PIPELINING: name: Connection pipelining default: False diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index d40d8dc2db..593644ded4 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -98,7 +98,12 @@ class Display: self._set_column_width() def set_cowsay_info(self): - if not C.ANSIBLE_NOCOWS: + if C.ANSIBLE_NOCOWS: + return + + if C.ANSIBLE_COWPATH: + self.b_cowsay = C.ANSIBLE_COWPATH + else: for b_cow_path in b_COW_PATHS: if os.path.exists(b_cow_path): self.b_cowsay = b_cow_path