我有一台多机Vagrantfile设置5节点环境.
我一直在四处寻找你对配置顺序的控制程度,但它非常有限:
https://docs.vagrantup.com/v2/multi-machine/
我想配置5个节点,然后返回第一个节点,并在那里运行其他配置步骤.
我的意思是你有一个像这样的Vagrantfile:
Vagrant.configure('2') do |config|
config.vm.provision some stuff
config.vm.define 'node1' do |node1|
node1.vm.provision some more stuff
end
config.vm.define 'node2' do |node2|
node2.vm.provision some other stuff
end
... node3 node4 node 5 ...
end
Run Code Online (Sandbox Code Playgroud)
但是在vagrant完成启动并将所有机器配置到node5之后,我想在node1上运行另一个配置器.有谁知道如何做到这一点?也许一些红宝石的hackery?
这是我的目标文件:
Sonatype Nexus
# ==============
# This is the most basic configuration of Nexus.
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus
# Nexus section
nexus-work=/opt/nexuswork
runtime=${bundleBasedir}/nexus/WEB-INF
Run Code Online (Sandbox Code Playgroud)
我知道使用正则表达式或简单的sed脚本有一种简单的方法:
sed -i 's/${bundleBasedir}\/..\/my\/second\/path\/002\/\/nexus/\/myfirstdir001\/g'
Run Code Online (Sandbox Code Playgroud)
但是,理想情况下,我更喜欢盐栈方式.
我希望它看起来像这样:
Sonatype Nexus
# ==============
# This is the most basic configuration of Nexus.
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-webapp=/my/second/path/002/nexus # changed
nexus-webapp-context-path=/nexus
# Nexus section
nexus-work=/opt/nexuswork
runtime=/myfirstdir001/nexus/WEB-INF # changed
Run Code Online (Sandbox Code Playgroud)
我还没有弄清楚这方面的saltstack文档.
Saltstack的salt.states.file.replace文档似乎相当简单:
http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.replace
这是我试过的:
/opt/nexus-2.8.0/conf/nexus.properties
file: # state
- replace
- pattern: '\$\{bundleBasedir\}' # without escapes: '${bundleBasedir}/nexus' …Run Code Online (Sandbox Code Playgroud) 我很确定我可以使用Erlang风格指南,但如果Elixir已经发展到类似PEP8的地步,我想尽快执行它*.
如果这只是一个意见问题,我想我会把Erlang风格指南融入我找到的社区风格指南中.
以下大多数社区编码标准"The Elixir Style Guide"看起来像是从Ruby风格指南借来的:
人们普遍认为风格是一种担忧,但我怀疑这些Elixir先驱中的许多人都是经验丰富的程序员.
是否有针对Elixir-lang发布的权威样式指南,如PEP8 for Python?
换句话说,PEP8是在python.org上发布的权威指南,如下所示:python.org/dev/peps/pep-0008.然而,Elixir风格指南是一项社区活动,虽然非常好.可能需要我在元编程和宏观定义上寻找或发展更多.
同样,Erlang有其编程规则:http://www.erlang.se/doc/programming_rules.shtml
Elixir是否有权威的,作者认可的风格指南,y/N?
*通过卑鄙,平均的wadies预先接收hoox
pip install pysqlite 失败,并输出以下错误日志:
? ~ pip install pysqlite
Collecting pysqlite
Using cached pysqlite-2.6.3.tar.gz
Installing collected packages: pysqlite
Running setup.py install for pysqlite
Complete output from command /home/nathan/.virtualenvs/tox/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-KwYD65/pysqlite/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K7uywC-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/nathan/.virtualenvs/tox/include/site/python2.7/pysqlite:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pysqlite2
copying lib/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dbapi2.py -> build/lib.linux-x86_64-2.7/pysqlite2
creating build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/types.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/userfunctions.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/transactions.py …Run Code Online (Sandbox Code Playgroud) 一个人。一个任务。使用Ansible配置Vagrant机器,以用作Python开发环境。
我试图用Ansible设置Vagrant机器。
我根据此处概述的说明为其设置了目录结构:https : //danielgroves.net/notebook/2014/05/development-environments/
一切如鱼得水,如对“无所事事”的回应的第一部分所示:
$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: wa2_default_1413954520562_41027
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Available bridged network interfaces:
1) wlan0
2) eth0
default: What interface should the …Run Code Online (Sandbox Code Playgroud) 我发现了一个木偶模块,其作者只是添加了一些修改,否则我必须手动完成.
字面上发生在20个小时前.
我已将master分支下载到zip文件,将其解压缩到我的modules文件夹,并运行puppet module build --verbose /etc/puppet/modules/arioch-redis,但无济于事.
我明白这绝对不是正常行为,但我觉得这个问题值得关注.
从源代码中使用模块肯定有一个用例,特别是在快速移动或依赖快速反馈的项目中.
我已就此做了一些研究,请随意问一下,"你有没有看过X"的问题.
例如,我查看了https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#build-your-module,但它似乎主要是为了将模块上传到Forge,而不是从本地安装资源.
另外,我的尝试在" 构建您的模块 "部分失败了.
下面的所有三个似乎用"安装librarian-puppet"来回答这个问题,但考虑到我们可以编写自己的模块,librarian-puppet使用来自公共可用git存储库的源代码来使用简单的代码似乎很愚蠢.模块:
更改木偶模块源(我在寻找的答案,会发生什么情况后的OP将会造成这个问题的答案私人回购协议.)
如何使用puppet模块安装从本地仓库安装puppet文件(我的借口:我不需要只使用该puppet module install工具.我也可以使用其他木偶工具.)
直接从克隆的回购中使用puppet模块(我的借口:答案似乎与此问题无关.)
从清单脚本安装puppet模块(我的借口:再次,我认为最适合该问题的最佳答案是"不要使用Puppet,找到解决方法."在这种情况下,解决方法是让Vagrant部分使用Shell Provisioning.)
如果这确实是重复或摘要,请在评论中说明,也许我可以解释一下.编辑欢迎!
我需要破解metadata.json内容吗?
我应该在某个地方克隆这个存储库并将其链接到我自己的临时Forge帐户,还是什么?
摘要:
我怎样才能获得该模块的最新版本,当它在其Git存储库中传递Travis时,但在Forge使其可用之前?
假设我有一种情况,我只需要在某些生产服务器上应用 Puppet 配置中的两个文件,而不需要触及配置的其余部分。
/opt/aservice/myfile/thekey.conf /opt/myfile/thekey.salt
我们还假设这些是由以下 Puppet 清单控制的:
#
# author: Nathan Basanese (nathan@basanese.com)
# date: 04/17/2048
#
class keyconfig ( $cluster ){
notify {"Deploying key config. files to $fqdn":}
file {'/opt/aservice/key/config/thekey.conf':
ensure => present,
mode => '0644',
owner => 'aservice-serv',
group => 'aservice-serv',
source => "puppet:///modules/keyconfig/$cluster/thekey.conf",
}
file {'/opt/aservice/key/config/thekey.salt':
ensure => present,
mode => '0644',
owner => 'aservice-serv',
group => 'aservice-serv',
source => "puppet:///modules/keyconfig/$cluster/thekey.salt",
}
}
Run Code Online (Sandbox Code Playgroud)
我如何从 Puppet Master 仅将这两个文件应用到给定服务器?
也许,在puppet agent目标服务器上运行的命令中,我可以指定要使用的特定 Puppet 类吗?
我以前使用过该puppet resource …