From d1332b83ee2661a4a896a49ba29b11aa1bad99db Mon Sep 17 00:00:00 2001 From: William L Thomson Jr Date: Mon, 12 Mar 2018 06:19:07 -0400 Subject: [PATCH] Add support for --quiet-build and --quiet-fail to portage module PR #36452 --- lib/ansible/modules/packaging/os/portage.py | 30 ++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/portage.py b/lib/ansible/modules/packaging/os/portage.py index 2cc3209e4f7..bc5e1699655 100644 --- a/lib/ansible/modules/packaging/os/portage.py +++ b/lib/ansible/modules/packaging/os/portage.py @@ -172,6 +172,25 @@ options: default: None version_added: 2.3 + quietbuild: + description: + - Redirect all build output to logs alone, and do not display it + - on stdout (--quiet-build) + required: false + default: False + choices: [ "yes", "no" ] + version_added: 2.6 + + quietfail: + description: + - Suppresses display of the build log on stdout (--quiet-fail) + - Only the die message and the path of the build log will be + - displayed on stdout. + required: false + default: False + choices: [ "yes", "no" ] + version_added: 2.6 + requirements: [ gentoolkit ] author: - "William L Thomson Jr (@wltjr)" @@ -320,6 +339,8 @@ def emerge_packages(module, packages): 'usepkgonly': '--usepkgonly', 'usepkg': '--usepkg', 'keepgoing': '--keep-going', + 'quietbuild': '--quiet-build', + 'quietfail': '--quiet-fail', } for flag, arg in emerge_flags.items(): if p[flag]: @@ -490,9 +511,16 @@ def main(): keepgoing=dict(default=False, type='bool'), jobs=dict(default=None, type='int'), loadavg=dict(default=None, type='float'), + quietbuild=dict(default=False, type='bool'), + quietfail=dict(default=False, type='bool'), ), required_one_of=[['package', 'sync', 'depclean']], - mutually_exclusive=[['nodeps', 'onlydeps'], ['quiet', 'verbose']], + mutually_exclusive=[ + ['nodeps', 'onlydeps'], + ['quiet', 'verbose'], + ['quietbuild', 'verbose'], + ['quietfail', 'verbose'], + ], supports_check_mode=True, )