mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7180/9021e741 backport][stable-7] community.general.make: (#7218)
community.general.make: (#7180)
* community.general.make:
allows parameters without value
closes #7178
* add changelog fragment for community.general.make
* correction: v != none -> v is not None
* update fragment changelog as per developer request
* add an example
* document the modification
* update example with comments as per maintainer request
(cherry picked from commit 9021e7416d
)
Co-authored-by: snail59 <25689269+snail59@users.noreply.github.com>
This commit is contained in:
parent
adfd73d7ed
commit
46d454eae0
2 changed files with 16 additions and 1 deletions
2
changelogs/fragments/7180-make_params_without_value.yml
Normal file
2
changelogs/fragments/7180-make_params_without_value.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- make - allows ``params`` to be used without value (https://github.com/ansible-collections/community.general/pull/7180).
|
|
@ -49,6 +49,7 @@ options:
|
||||||
params:
|
params:
|
||||||
description:
|
description:
|
||||||
- Any extra parameters to pass to make.
|
- 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
|
type: dict
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
|
@ -90,6 +91,18 @@ EXAMPLES = r'''
|
||||||
chdir: /home/ubuntu/cool-project
|
chdir: /home/ubuntu/cool-project
|
||||||
target: all
|
target: all
|
||||||
file: /some-project/Makefile
|
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:
|
||||||
|
# This adds -DWITH_FDT to the command line:
|
||||||
|
-DWITH_FDT:
|
||||||
|
# The following adds TARGET=arm64 TARGET_ARCH=aarch64 to the command line:
|
||||||
|
TARGET: arm64
|
||||||
|
TARGET_ARCH: aarch64
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = r'''
|
RETURN = r'''
|
||||||
|
@ -190,7 +203,7 @@ def main():
|
||||||
# Fall back to system make
|
# Fall back to system make
|
||||||
make_path = module.get_bin_path('make', required=True)
|
make_path = module.get_bin_path('make', required=True)
|
||||||
if module.params['params'] is not None:
|
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 is not None else '') for k, v in iteritems(module.params['params'])]
|
||||||
else:
|
else:
|
||||||
make_parameters = []
|
make_parameters = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue