ansible常用模块之 -- make模块 – 在Makefile中运行目标

ansible常用模块之 -- make模块 – 在Makefile中运行目标

make模块 – 在Makefile中运行目标

一、摘要

  • 在Makefile中运行目标

二、参数

参数选项/默认值描述
chdir
path
required
在运行make之前切换到此目录。
file
path
使用自定义Makefile。
params
dictionary
任何要传递的额外参数。
target
string
要运行的目标。通常情况下,这可能是install、test或all。”

三、示例

# 构建默认目标
- name: Build the default target
  make:
    chdir: /home/ubuntu/cool-project

# 以根用户身份运行“install”目标器
- name: Run 'install' target as root
  make:
    chdir: /home/ubuntu/cool-project
    target: install
  become: yes

# 用额外的参数构建'all'目标
- name: Build 'all' target with extra arguments
  make:
    chdir: /home/ubuntu/cool-project
    target: all
    params:
      NUM_THREADS: 4
      BACKEND: lapack

# 使用自定义Makefile构建“all”目标
- name: Build 'all' target with a custom Makefile
  make:
    chdir: /home/ubuntu/cool-project
    target: all
    file: /some-project/Makefile

官方文档: https://docs.ansible.com/ansible/2.9/modules/make_module.html#make-module

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值