Files
ansible_role_package/tasks/helpers/make.yml
Matthew Stobbs bc7364185b add archive to make helper
- helper 'make' will check for repo to use git, and extract_to to use
archive
- configure target is changed to run the ./configure script
2026-04-18 11:16:02 -06:00

82 lines
2.1 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Helper: make.yml
## Description: run make to build packages
## Variables:
##
---
- name: Fetch source code git
vars:
path: "{{ pkg.path }}"
repo: "{{ pkg.repo }}"
version: "{{ pkg.version | default(omit) }}"
when:
- pkg.repo is defined
ansible.builtin.include_tasks: helpers/git.yml
- name: Fetch source code archive
vars:
archive: "{{ pkg }}"
when:
- pkg.extract_to is defined
ansible.builtin.include_tasks: helpers/archive.yml
- name: Run configure target
when:
- pkg.target.configure is defined
register: make_configure
ansible.builtin.command:
chdir: "{{ pkg.path }}"
argv: ["./configure", "{{ pkg.target.configure.options }}"]
- name: Run build target
when:
- pkg.target.build is defined
register: make_build
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ pkg.target.build.name }}"
params: "{{ target.params | default(omit) }}"
- name: Clean old installation
vars:
files: "{{ pkg.install_files }}"
when:
- pkg.install_files is defined
ansible.builtin.include_tasks: helpers/clean_install.yml
- name: Run preinstall targets
when:
- pkg.targets.preinstall is defined
loop: "{{ pkg.targets.preinstall }}"
loop_control:
loop_var: target
register: make_preinstall
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}"
- name: Run install target
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"
when:
- pkg.targets.install is defined
register: make_install
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ pkg.targets.install.name }}"
params: "{{ pkg.targets.install.params | default(omit) }}"
- name: Run postinstall targets
when:
- pkg.targets.postinstall is defined
loop: "{{ pkg.targets.postinstall }}"
loop_control:
loop_var: target
register: make_postinstall
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}"