【问题标题】:Ansible configure and makeAnsible 配置和制作
【发布时间】: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


【解决方案1】:

我找到了根本原因。当我安装 python 时,我编辑了 /etc/profile 但这被 ansible 登录忽略了。因此,LD_LIBRARY_PATH 没有被设置。此后,我更新了 python 安装程序手册,将 shell 脚本添加到 /etc/profile.d/

令人惊讶的是,配置步骤并没有出错,即使它未能正确运行 python。可能是因为配置脚本没有返回非零值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    • 2020-12-10
    • 2015-11-11
    • 2020-04-12
    • 1970-01-01
    相关资源
    最近更新 更多