2016-11-07 100 views
0

如何使用编程名称在Ansible中创建符号链接?创建具有编程名称的符号链接

我需要这个LDAP。命令我通常运行是这样的:

ln -s /etc/openldap/cacerts/mycert.pem /etc/openldap/cacerts/`openssl x509 -noout -hash -in /etc/openldap/cacerts/mycert.pem`.0 

指挥舱不接受这样的命令,它会说

"stderr": "ln: invalid option -- 'o'\nTry 'ln --help' for more information." 

而且这意味着该文件模块似乎并不支持添加一些shell命令。 Ansible可以做些什么来解决这个问题?

回答

1

尝试使用外壳模块:

shell: ln -s /etc/openldap/cacerts/mycert.pem /etc/openldap/cacerts/`openssl x509 -noout -hash -in /etc/openldap/cacerts/mycert.pem`.0 
+0

似乎工作。 Ansible日志在每次运行中都会警告我,但现在这样做。 – Kaspar

相关问题