Skip to content
Closed
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
30 changes: 30 additions & 0 deletions roles/cifmw_make/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


# All variables intended for modification should use the cifmw_make prefix.

# Directory containing the Makefile (required).
cifmw_make_chdir: "{{ cifmw_repo }}"

# Make target name (required).
cifmw_make_target: ""

# Install the OS "make" package before running the target (requires become on that task).
cifmw_make_install_make_pkg: true

# Extra environment variables for the make process.
cifmw_make_environment: {}
28 changes: 28 additions & 0 deletions roles/cifmw_make/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


galaxy_info:
author: CI Framework
description: Thin wrapper around community.general.make
company: Red Hat
license: Apache-2.0
min_ansible_version: "2.14"
namespace: cifmw
galaxy_tags:
- cifmw

dependencies: []
39 changes: 39 additions & 0 deletions roles/cifmw_make/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Validate cifmw_make_chdir and cifmw_make_target
ansible.builtin.assert:
that:
- cifmw_make_chdir is string
- cifmw_make_chdir | length > 0
- cifmw_make_target is string
- cifmw_make_target | length > 0
fail_msg: >-
cifmw_make_chdir must be a non-empty path to the directory containing the Makefile,
and cifmw_make_target must be a non-empty make target name.

- name: Ensure make is installed for Makefile targets
when: cifmw_make_install_make_pkg | bool
become: true
ansible.builtin.package:
name: make
state: present

- name: Run make
community.general.make:
chdir: "{{ cifmw_make_chdir }}"
target: "{{ cifmw_make_target }}"
environment: "{{ cifmw_make_environment }}"
Loading