【发布时间】:2016-06-27 15:18:17
【问题描述】:
配置和不作为单独的步骤工作。
- name: configure
command: ./configure --with-python=/usr/local/bin/python2.7
args:
chdir: "/usr/src/mod_wsgi-{{ mod_wsgi_version }}"
- name: make
command: make
args:
chdir: "/usr/src/mod_wsgi-{{ mod_wsgi_version }}"
但是,当我将它们组合在一个命令行中时,它们可以正常工作。
- name: configure and make
command: ./configure --with-python=/usr/local/bin/python2.7; make
args:
chdir: "/usr/src/mod_wsgi-{{ mod_wsgi_version }}"
我的理解是,configure 是在构建一个 makefile,而不是在环境中做一些神奇的事情。我错了吗?
编辑: 我得到了线索,python 无法正常运行,因为它需要一个环境变量:LD_LIBRARY_PATH。
我找到了根本原因。当我安装 python 时,我编辑了 /etc/profile 但这被 ansible login 忽略了。因此 LD_LIBRARY_PATH 没有被设置。此后我更新了 python 安装程序手册,将 shell 脚本添加到 /etc/profile.d/
【问题讨论】:
-
奇数。第一个剧本看起来应该可以工作。你能用 -vvvv 运行它并提供调试输出吗?
标签: makefile ansible configure