puppet

puppet node hostname

。_饼干妹妹 提交于 2019-12-02 23:39:14
I'm using puppet to configure servers. I want to print current machine (node) name in *.erb template. There is hostname variable, but this holds puppetmaster hostname. Is there any good reference/list regarding to this topic? Michal Bryxí Seems like I have miss-looked somewhere. I can get(print) node-hostname simply by invoking following code in *.erb template: <%= @hostname %> Edit: As of Puppet 3, using local variables (i.e. hostname is deprecated; Puppet 4 will remove support for them entirely. The recommended way is to use instance variables (prefixed with @ . So in this case, @hostname .

access private VM from other computer over wifi

本小妞迷上赌 提交于 2019-12-02 23:13:38
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 = "http://files.vagrantup.com/precise64.box" config.vm.network :private_network, ip: "10.10.10.10" config

自动化运维经验谈,以及为什么Docker是革命性的

匿名 (未验证) 提交于 2019-12-02 21:53:52
互联网+的需要 在信息越来越繁杂的互联网时代,公司所运行的项目越来越多,项目相关服务繁多,服务之间存在复杂的依赖关系,运维与管理任务越来越繁重,手工交付需要花费很多的人力与时间,且安全性和时效性均无法保证。对于多资源型分布/分离式部署项目,Udeployer应运而生。 随着企业对版本上线质量和速度的要求越来越高,敏捷开发、Devops的接受度越来越高 传统的交付方式因为项目之间缺少依赖、环境不一致、版本不一致、人为操作失误等情况使得项目交付过程中问题不断,而互联网企业发展节奏快、版本发布频率高,上线出故障影响面广、影响度高,因而企业对于敏捷开发、持续集成、自动发布都有强烈的需求。 自动化从构建和测试开始 运维自动化的关键在于标准化。当你有一个成熟的团队,有标准化的流程,那么运维自动化就水到渠成了。而如果你什么都没有,那就需要先设定优先级。 我们的目标当然是将所有的流程标准化,而哪些要放在前面做?做起来比较简单的,和比较重要的。我认为构建和测试的流程是最基本的第一步。这对于交付产品的公司来说容易一些,对互联网公司来说更复杂一些,而测试比构建也要复杂一些,但这是基础。构建和测试的流程标准化做好了,就可以准备做自动化的工作了。 不过我见过的很多公司连Git都还没有,仍然在用最原始的FTP push来更新代码。我的观点是,如果你还没有用上Git这样的工具,那根本就不用考虑什么自动化的问题

Using hiera to set class parameters?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 18:25:29
问题 I am trying to figure out how to use hiera for setting the values for class parameters. I am testing things out with two simple classes: testhiera and testhiera2 Here are those classes: [root@puppet-el7-001 modules]# cat testhiera/manifests/init.pp class testhiera ( $haproxy_cert_content = 'unknown' , ) { notify {"cert is $haproxy_cert_content":} } [root@-puppet-el7-001 modules]# cat testhiera2/manifests/init.pp class testhiera2 ( $haproxy_cert_content = 'unknown' , ) { notify {"number two

nginx on Ubuntu: Permission denied

此生再无相见时 提交于 2019-12-02 17:37:01
I am new to system administration. After installing nginx via puppet on Ubuntu I get the following output: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) [warn] 1898#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 [emerg] 1898#0: open() "/var/log/nginx/access.log" failed (13: Permission denied) How do I get rid of all of these messages? I don't want to use command line directly (chown / chmod) and repeat it every time I create a new server. Therefore, I am

Vagrant provisioning shell vs puppet vs chef

感情迁移 提交于 2019-12-02 14:39:25
I have the following setup: Many different projects which are separate git repositories, but all have mostly the same server configuration Each project in turn depends on many other projects and we use the composer dependency manager to get them together (PHP language here). I want to use Vagrant and include a Vagrant file in each repository, so my team members can clone a repository, run vagrant up and be ready to go. My question is now directed towards the provisioning. I need to install several tools and packages like apache, git, mysql and several php packages, then download some files

Puppet 6 and module puppetlabs/accounts does not create user account in Hiera YAML format

天大地大妈咪最大 提交于 2019-12-02 09:24:52
When I run puppet agent --test I have no errors output but the user did not create. My puppet hira.yaml configuration is: --- version: 5 datadir: "/etc/puppetlabs/code/environments" data_hash: yaml_data hierarchy: - name: "Per-node data (yaml version)" path: "%{::environment}/nodes/%{::trusted.certname}.yaml" - name: "Common YAML hierarchy levels" paths: - "defaults/common.yaml" - "defaults/users.yaml" users.yaml is: accounts::user: joed: locked: false comment: System Operator uid: '1700' gid: '1700' groups: - admin - sudonopw sshkeys: - ssh-rsa ...Hw== sysop+moduledevkey@puppetlabs.com I use

Changing puppet module source

家住魔仙堡 提交于 2019-12-02 04:51:55
I checked Puppet's documentation but didn't find any suggestions about it. I have Puppet module for Monit - https://forge.puppetlabs.com/dhoppe/monit . It already has some predefined configurations for some services in files folder - https://github.com/dhoppe/puppet-monit/tree/master/files/common/etc/monit/conf.d . I want to add more, but not sure how to do it in the correct puppet way. Is it ok to add new service configuration to local `puppet/module/monit/files/ folder? Will this folder be overwritten when update for module comes? Or maybe there is a better way for it? PS. My services aren't

Undefined local variable or Method - Testing Puppet Modules using Beaker

风流意气都作罢 提交于 2019-12-02 04:01:39
I'm quite new to all of this. I am trying to test out a puppet module using Beaker. I keep getting this: NoMethodError: undefined method `describe' for #Beaker::TestCase:0x007fd6f95e6460 /Users/user1/beaker/Puppet/puppet-files/spec/classes/unit_spec.rb:3 /Users/user1/.rvm/gems/ruby-2.2.7/gems/beaker-3.24.0/bin/beaker:9 /Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15 /Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15. This is the command that I'm running - "beaker --hosts myhost.yaml --pre-suite spec". My unit_spec.rb contains this: require 'puppetlabs_spec_helper