puppet

Issues adding attribute to XML root node via augeas

荒凉一梦 提交于 2019-12-01 07:24:21
问题 I am using augeas to manipulate XML on some machines. Whereas creating new nodes and also setting a bunch of attributes worked like a charm I'm biting my nails of adding a simple attribute to an XML file. XML looks like the following: <?xml version="1.0"?> <Context> <WatchedResource></WatchedResource> </Context> I'm no just trying to add allowLinking="true" to the Context root node via set /files/path/to/my/file.xml/Context/#attribute/allowLinking "true" Which is unfortunately always failing

convert ip address to 32 bit integer in ruby

懵懂的女人 提交于 2019-12-01 03:33:36
I am trying to find a way to convert a ip address to a 32 bit integer in Ruby for a puppet template. This is how I did the conversion in bash. root@ubuntu-server2:~# cat test.sh #!/bin/bash #eth0 address is 10.0.2.15 privip=`ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1` ; echo "Private IP: ${privip}" ; # Turn it into unsigned 32-bit integer ipiter=3 ; for ipoctet in `echo ${privip} | tr . " "` ; do ipint=$(( ipint + ( ipoctet * 256 ** ipiter-- ) )) ; done ; echo "Private IP int32: ${ipint}" ; . root@ubuntu-server2:~# bash test.sh Private IP: 10.0.2.15 Private IP int32:

convert ip address to 32 bit integer in ruby

a 夏天 提交于 2019-11-30 23:50:09
问题 I am trying to find a way to convert a ip address to a 32 bit integer in Ruby for a puppet template. This is how I did the conversion in bash. root@ubuntu-server2:~# cat test.sh #!/bin/bash #eth0 address is 10.0.2.15 privip=`ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1` ; echo "Private IP: ${privip}" ; # Turn it into unsigned 32-bit integer ipiter=3 ; for ipoctet in `echo ${privip} | tr . " "` ; do ipint=$(( ipint + ( ipoctet * 256 ** ipiter-- ) )) ; done ; echo

How to store linux command output into a variable in puppet

谁说我不能喝 提交于 2019-11-30 13:54:04
Is it possible to store a linux command result in variable? I am trying to store an encrypted value in a variable. To encrypt I am using base64 command. To store it in variable, I am using generate method. But I am not able to store a value. $secretvalue = generate("/bin/bash","-c","/usr/bin/echo ${password} | /usr/bin/base64") If you want to execute any command on Puppet Master server you can use inline_template function with ERB template inside and Ruby code for execute shell command: $password = "12345" $secretvalue = inline_template("<%= `/bin/echo ${password} | /usr/bin/base64` %>")

Vagrant, Docker, Puppet, Chef

回眸只為那壹抹淺笑 提交于 2019-11-30 12:21:19
问题 I don't understand even the basic difference between the services in the title. Do these services just provide software to help you configure/organize/manage your VM's, or do they also provide physical infrastructure for your VM's to run on? In other words, are they just convenient interfaces between developers and AWS, Rackspace, and Azure? 回答1: Not exactly. Chef/Puppet are the "same", they are configuration management. While you can use them to manage virtual machines or public/private

20款开发运维必备的顶级工具

你离开我真会死。 提交于 2019-11-30 01:55:17
开发运维工具与软件开发领域的最佳实践密切相关,也与必要的规范密切相关。在整个开发生命周期涉及到一大批新旧工具,从规划、编码、测试、发布到监控。本文介绍你应该考虑添加到工具箱中的20种开发运维工具,供大家参考。 开发运维是那些还没有得到明确定义,就流传开来的科技时髦词之一。这种情况时不时出现,某个好的概念问世后,人们还无法实际上解释它为何物,就趋之若鹜。 所以,考虑到开发运维本身在大家的头脑中还是一片模糊,开发运维工具怎么样呢? 有必要说清一点:开发运维是开发和运维的混合体,因为它代表了开发实践方面的文化变化,非开发人员也参与到软件开发过程中。开发人员之外的IT专业人员参与到构建应用程序的协作和沟通过程,让产品开发完毕后使用产品的人有机会在开发过程中,而不是在开发结束后,对应用程序的构建发表意见。 成熟的开发运维环境往往遵循一种常见模式:一种灵活的软件定义平台上的迭代自动化。所以,许多开发运维工具采用了某种迭代动作。采用开发运维工具的 成功的流程既需要公司里面的文化变化,又需要实现这种变化的新工具。这意味着,在整个开发生命周期涉及到一大批新旧工具,从规划、编码、测试、发布到监 控。下面是你应该考虑添加到工具箱中的20种开发运维工具,但绝不是全部。 1.Jira Software 来自Altassian的JIRA软件是一款流行的软件开发工具,用于开发运维的一个关键部分:敏捷开发

Puppet/Facter “Could not retrieve fact fqdn”: How to fix or circumvent?

依然范特西╮ 提交于 2019-11-29 21:15:38
I'm learning about puppet and trying to experiment with it on a VM at home. I'm not using a puppet server yet, just running things locally. It works okay, but every time I run puppet apply ... , I get a delay of several seconds, after which it displays the message warning: Could not retrieve fact fqdn I assume the message is linked to the delay, and I want to get rid of it (the delay--I can live with the message). Googling for a solution seems to indicate that it's somehow related to DNS lookups, but I can't really find anything else about it, which seems surprising. All I want is to be able

OpenSSL vs GPG for encrypting off-site backups?

冷暖自知 提交于 2019-11-29 20:15:15
Given the option between using GPG and OpenSSL for local encryption before pushing archives to an off-site backup location, what are the benefits and drawbacks of each solution? Background: I currently manage a server infrastructure based on Ubuntu 14.04.1 with all current patches applied as they become available. All of these systems are headless, automatically built using vetted preseeds and automation tools, and run in virtual machines via KVM on uniform Intel-based hardware. We have a preference for Ruby, but a stronger preference for "doing things correctly". Because of both, we've chosen

Configuration Management for Windows [closed]

拜拜、爱过 提交于 2019-11-29 19:19:25
Are there any tools for windows like that *nix world has? I am looking for something like Chef or Puppet . I have found cfEngine but it still looks very *nix centric. Ideally it would be open source, and command line driven. The idea is to put together an automated infrastructure with windows based servers. Our current IT department does not allow non-windows servers. Chef is supported on Windows by Opscode. While we don't run Windows for any of our infrastructure, we do have developers who are continually improving our Windows support. We also get community contributions, and most of the

自动化运维专题之puppet课程内容大纲

ぃ、小莉子 提交于 2019-11-29 17:16:53
第一部分 puppet基础 一、puppet概述 1.1 puppet功能简介 1.2 puppet项目说明 二、puppet基础原理 2.1 puppet基础概念 2.1.1 资源 2.1.2 资源清单 2.1.3 类 2.1.4 模块 2.1.5 catalog 2.2 puppet的三层模型 2.2.1 资源抽象层 2.2.2 事务层 2.2.3 配置语言 2.3 puppet工作模型 2.3.1 单机模型 2.3.2 master/agent模型 2.4 puppet工作流程 2.4.1 单机模型工作流程 2.4.2 master/agent模型工作流程 三、puppet安装配置 本部分揉碎至后续各部分中讲解。 第二部分 puppet概念详解以及在单机模型中使用puppet 四、puppet资源 4.1 资源申报 4.1.1 常见的资源类型 4.1.2 资源类型相关帮助信息的获取及查看 4.1.3 申报资源 4.1.3.1 user和group资源 4.1.3.2 file资源 4.1.3.3 notify资源 4.1.3.4 service资源 4.1.3.5 exec资源 4.1.3.5 service资源 4.2 资源依赖:顺序和通知 4.2.1 资源依赖关系概述 4.2.2 资源应用顺序 4.2.2.1 before属性 4.2.2.2 require属性 4.2