puppet

access private VM from other computer over wifi

爷,独闯天下 提交于 2019-12-04 08:25:25
问题 I have a private network VM for developing on my mac. I'd like for my android device to be able to communicate with the VM on my mac. Currently I can visit the IP defined in my Vagrantfile, 10.10.10.10, on my mac and access it just fine but I can't access it via my phone on the same wifi. What do I need to do to make it available across my local network and visible to my phone over wifi? Here's my Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url =

Hosting rails on ec2

◇◆丶佛笑我妖孽 提交于 2019-12-04 07:47:58
I want to deploy a rails onto amazon ec2. I've had a look at poolparty and ec2onrails but neither seem to be maintained anymore. What are people using to do this? Is it all homebrewed puppet and capistrano or is there a project that will get me going? I can recommend two projects: If you have a single Rails app, take a look at Rubber . It's a gem that can provision EC2 instances for you, install software and deploy your app. It's based on Capistrano. There are recipes for the most common components (mysql, apache, passenger, postgres, etc.). In case you have more complex setup (e.g. multiple

01 ansible的基本介绍

亡梦爱人 提交于 2019-12-04 06:01:20
1、现有的企业服务器环境   在现在的企业中,特别是互联网公司,他们的业务量众多;比如负载均衡服务器、web服务器、动态解析(php)服务器、数据库(mysql)服务器以及网站缓存服务器,等等;   例如:一个hadoop集群就有上前台的服务器;这样的话,如何批量管理这些服务器是一个很大的问题;   第二个问题,为了提高管理效率,必须把服务器的基础环境设施配置好,就好像高速公路一样,如果不平,则汽车的速度也无法提起来;   所以,我们首先需要一个批量化管理系统程序,其次,系统的硬件设备不能相差太大; 2、运维工作基本介绍   想要做批量化管理,我们首先就要知道,那些事情需要进行批量操作;基本上,很多的运维工作都是需要进行,或者说都是可以进行批量化操作的;   总体来说,运维人员包括的基本工作有:     1、系统安装(包括物理机和虚拟机)    物理机通过PEX 或则要求厂家安装   虚拟机 则是通过glance 镜像模板这种技术来实现(克隆)     2、程序包的安装       对程序进行配置,满足使用者的需求,然后需要启动服务,保证服务正常运行;         3、程序发布       这里的程序一般指的是开发人员开发的程序代码,运维人员需要将其在生产环境下面进行部署与配置;现在程序更新、且现在都是以敏捷模式开发,每周都需要更新一次,并部署到生产环境下;      

How to convert array to comma separated string in Puppet 2.7

拥有回忆 提交于 2019-12-04 00:11:46
I am using Puppet 2.7 and I need to convert an array to comma separated list. $hosts_fqdn= ['host1','host2','host3'] And I need to convert it to desired result: 'host1,host2,host3' I guess that Puppet 3.2 offers lambda expression - reduce . But unfortunately that is not possible with 2.7. jaksky Function join from puppetlabs/stdlib : join($hosts_fqdn,",") 来源: https://stackoverflow.com/questions/18526456/how-to-convert-array-to-comma-separated-string-in-puppet-2-7

How to Mock a Custom Type in Rspec-Puppet

Deadly 提交于 2019-12-03 22:17:01
I am able to test custom types using rspec-puppet due to implementing the answer of this question. However, I would like to avoid to create a symlink to the custom folder in every puppet-module by mocking cystom types . The question is how to mock Custom Puppet Types in Rspec-Puppet. I have found an example regarding the mocking of a Custom Puppet Function but I am looking for an example to mock Puppet Custom Types . Puppet Code class vim::ubuntu::config { custom_multiple_files { 'line_numbers': ensure => 'present', parent_dir => '/home', file_name => '.vimrc', line => 'set number'; } } Rspec

VSCode - how to keybind an external command

99封情书 提交于 2019-12-03 20:49:40
Im trying to run "puppet-lint -f (currently open file) The Puppet extenstion provides puppet-lint check, but doesnt auto fix any issues, it just gives warnings. How can I add a keyboard shortcut to run "puppet-lint -f" on a file Im currently editing? Thanks I don't know anything about the Puppet extension but in general here is how you can bind a shell command to a keychord: Make a task for it (.vscode/tasks.json): { "version": "2.0.0", { "label": "node version", "command": "node", "args": [ "-v" ], "type": "shell" } } In the args: you may use ${file} for the current file. Then in keybindings

Iterate over a hash key/values in Puppet

让人想犯罪 __ 提交于 2019-12-03 17:01:35
I'm dabbling with Puppet to update an arbitrary list of appsettings in an ASP.NET web.config (for deployment purpose) and I'm in a dilemma, mostly because I'm a real n00b in puppet. I have this yaml file (hiera) --- appSettings: setting1: "hello" setting2: "world!" setting3: "lalala" the number of setting[x] can span arbitrarily (one appSetting) and I would like to loop through the hash keys/value to update the corresponding appSetting/add in the web.config (using exec with powershell) the problem is i've searched high and low on how to iterate on keys and values . I came across create

How can I split my hiera config by role?

▼魔方 西西 提交于 2019-12-03 14:26:56
I'm using hiera to assign classes like webserver or dbserver to my nodes. The webserver class just includes apache and sets some config on it (e.g. port). Obviously I don't want to replicate this config for every node, so I put it in common.yaml. However, my common.yaml is getting big, so I want to split it up. I'd like to have one file containing the config for the webserver role, another for the dbserver role etc. I'm imagining my hiera.yaml to look something like this: :hierarchy: - "fqdn/%{::fqdn}" - "role/%{ROLE}" - common Where the role folder would contain files like webserver.yaml ,

Using Vagrant, why is puppet provisioning better than a custom packaged box?

时光毁灭记忆、已成空白 提交于 2019-12-03 12:21:10
I'm creating a virtual machine to mimic our production web server so that I can share it with new developers to get them up to speed as quickly as possible. I've been through the Vagrant docs however I do not understand the advantage of using a generic base box and provisioning everything with Puppet versus packaging a custom box with everything already installed and configured. All I can think of is; Advantages of using Puppet vs custom packaged box Easy to keep everyone up to date - Ability to put manifests under version control and share the repo so that other developers can simply pull new

How can I stop and delete a docker container launched with restart always option?

这一生的挚爱 提交于 2019-12-03 11:02:33
I run some containers with the option --restart always . It works good, so good, that I have now difficulties to stop these containers now :) I tried : sudo docker stop container && sudo docker rm -f container But the container still restarts. The docker documentation explains the restart policies, but I didn't find anything to resolve this issue. Just sudo docker rm -f container will kill the process if it is running and remove the container, in one step. That said, I couldn't replicate the symptoms you described. If I run with --restart=always , docker stop will stop the process and it