简体   繁体   English

人偶使用人偶从配置文件获取用户名

[英]Puppet get username from Configuration file using puppet

I need to build a RPM for a set of libraries, but the problem is I can compile and build it in Dev server and need to deploy in all QA, PROD and test servers which has different user names, so I need to build my rpm to contain and pick username for respective servers during installation, can someone help me with this. 我需要为一组库构建一个RPM,但问题是我可以在Dev服务器中进行编译和构建,并且需要在具有不同用户名的所有QA,PROD和测试服务器中进行部署,因此我需要构建rpm在安装过程中包含并选择各个服务器的用户名,有人可以帮助我吗? How to do this using puppet..? 如何使用puppet ..? Is that possible? 那可能吗?

This cannot be done cleanly with stock RPMs. 使用库存RPM不能做到这一点。

As a hack, you can have a %post script chown all the files after detecting which username to use, but that's going to cause errors later when you do things like try to verify the RPM installation. 作为一个黑客,你可以有一个%post脚本chown所有文件检测要使用的用户名之后,但是这会在以后导致的错误,当你不喜欢的东西尝试验证RPM安装。

I'd recommend (a) having a new username that you use for the RPM/service across all servers or (b) building separate RPMs for each target environment. 我建议(a)为所有服务器上的RPM /服务使用一个新的用户名,或(b)为每个目标环境构建单独的RPM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM