Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community.general.make: #7180

Merged
merged 7 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/7180-make_params_without_value.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- make - allows ``params`` to be used without value (https://github.com/ansible-collections/community.general/pull/7180).
15 changes: 14 additions & 1 deletion plugins/modules/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=).
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
type: dict
target:
description:
Expand Down Expand Up @@ -90,6 +91,18 @@
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:
# 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'''
Expand Down Expand Up @@ -190,7 +203,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 is not None else '') for k, v in iteritems(module.params['params'])]
else:
make_parameters = []

Expand Down