我正在尝试从我们编码的Python应用程序创建安装程序.我写了一个简单的setup.py文件,它生成.msi文件没问题,但我无法弄清楚指定默认安装路径的方法.我们不希望它安装到默认的"C:\ Program Files"目录.救命?
我正在尝试为我的所有服务器创建一个"模板".我有2个配置.一个NTP客户端(在基类类中处理.我想通过在节点声明中声明特定的东西来创建特定于NTP服务器的覆盖.类似于"baseclass :: ntp:restrict => true".或者或者,我如何从baseclass :: ntp更改已声明的变量之一?
有没有人有任何想法主办这样做?
这是我到目前为止:
templates.pp
class baseclass {
include defaultusers
include sudoers
include issue
class { ntp:
ensure => running,
servers => ['ntpserver1.host.com',
'ntpserver2.host.com',],
autoupdate => false,
}
}
Run Code Online (Sandbox Code Playgroud)
nodes.pp
node default {
include baseclass
}
node "ntpserver1.host.com" inherits default {
<some code here to declare new variable in baseclass::ntp>
<some code here to change existing variable, such as "ensure">
}
Run Code Online (Sandbox Code Playgroud)