From dfde39441d3378eee82a730c554e1869aae750d6 Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 01:59:43 +0200 Subject: [PATCH 1/7] community.general.make: allows parameters without value closes #7178 --- plugins/modules/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/make.py b/plugins/modules/make.py index 665457fd6dc..ae7a33927f2 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -190,7 +190,7 @@ def main(): # Fall back to system make make_path = module.get_bin_path('make', required=True) if module.params['params'] is not None: - make_parameters = [k + '=' + str(v) for k, v in iteritems(module.params['params'])] + make_parameters = [k + (('=' + str(v)) if v != None else '') for k, v in iteritems(module.params['params'])] else: make_parameters = [] From 090b22efb7e091215b3f79251ab930891381865c Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 02:49:19 +0200 Subject: [PATCH 2/7] add changelog fragment for community.general.make --- changelogs/fragments/7180-make_params_without_value.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7180-make_params_without_value.yml diff --git a/changelogs/fragments/7180-make_params_without_value.yml b/changelogs/fragments/7180-make_params_without_value.yml new file mode 100644 index 00000000000..1cf28cabf02 --- /dev/null +++ b/changelogs/fragments/7180-make_params_without_value.yml @@ -0,0 +1,2 @@ +minor_changes: + - make module - allows params to be used without value From 124e3c5b8b08ccf0edb0cce470f7b3097c8ba885 Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 02:56:38 +0200 Subject: [PATCH 3/7] correction: v != none -> v is not None --- plugins/modules/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/make.py b/plugins/modules/make.py index ae7a33927f2..274504893e4 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -190,7 +190,7 @@ def main(): # Fall back to system make make_path = module.get_bin_path('make', required=True) if module.params['params'] is not None: - make_parameters = [k + (('=' + str(v)) if v != None else '') for k, v in iteritems(module.params['params'])] + make_parameters = [k + (('=' + str(v)) if v is not None else '') for k, v in iteritems(module.params['params'])] else: make_parameters = [] From 64eec454d5a94621746b5f217409c91f7bad727a Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:25:30 +0200 Subject: [PATCH 4/7] update fragment changelog as per developer request --- changelogs/fragments/7180-make_params_without_value.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/7180-make_params_without_value.yml b/changelogs/fragments/7180-make_params_without_value.yml index 1cf28cabf02..114b5b48c83 100644 --- a/changelogs/fragments/7180-make_params_without_value.yml +++ b/changelogs/fragments/7180-make_params_without_value.yml @@ -1,2 +1,2 @@ minor_changes: - - make module - allows params to be used without value + - make - allows ``params`` to be used without value (https://github.com/ansible-collections/community.general/pull/7180). From 35b5eed27330a6c3bf6a512a06198c27fe1d4593 Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:51:55 +0200 Subject: [PATCH 5/7] add an example --- plugins/modules/make.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/modules/make.py b/plugins/modules/make.py index 274504893e4..339ec126729 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -90,6 +90,16 @@ chdir: /home/ubuntu/cool-project target: all file: /some-project/Makefile + +- name: build arm64 kernel on FreeBSD, with 16 parallel jobs + community.general.make: + chdir: /usr/src + jobs: 16 + target: buildkernel + params: + -DWITH_FDT: + TARGET_ARCH: aarch64 + TARGET: arm64 ''' RETURN = r''' From edafde3d9bc794838076021135216fb4624ebd93 Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:15:36 +0200 Subject: [PATCH 6/7] document the modification --- plugins/modules/make.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/modules/make.py b/plugins/modules/make.py index 339ec126729..5b470a41078 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -49,6 +49,7 @@ params: description: - Any extra parameters to pass to make. + - If the value is empty, only the key will be used. For example, V(FOO:) will produce V(FOO), not V(FOO=). type: dict target: description: From ca4ae79d0ab91cd0782ed4f902d667f6df12d205 Mon Sep 17 00:00:00 2001 From: David BOYER <25689269+snail59@users.noreply.github.com> Date: Sun, 3 Sep 2023 18:39:43 +0200 Subject: [PATCH 7/7] update example with comments as per maintainer request --- plugins/modules/make.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/modules/make.py b/plugins/modules/make.py index 5b470a41078..39392afca63 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -98,9 +98,11 @@ jobs: 16 target: buildkernel params: + # This adds -DWITH_FDT to the command line: -DWITH_FDT: - TARGET_ARCH: aarch64 + # The following adds TARGET=arm64 TARGET_ARCH=aarch64 to the command line: TARGET: arm64 + TARGET_ARCH: aarch64 ''' RETURN = r'''