This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ src/augtool -I lenses/ -r / -A -t Fstab=/etc/mtab -t Fstab=/etc/fstab | |
augtool> ls /files/etc/ | |
mtab/ = (none) | |
fstab/ = (none) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raphink@obadiah:~/Documents$ cat fakeroot/etc/inittab | |
co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav | |
raphink@obadiah:~/Documents$ augtool -r fakeroot/ print /files/etc/inittab | |
/files/etc/inittab | |
/files/etc/inittab/co | |
/files/etc/inittab/co/runlevels = "2345" | |
/files/etc/inittab/co/action = "respawn" | |
/files/etc/inittab/co/process = "/sbin/agetty xvc0 9600 vt100-nav" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApacheParamsModule | |
def initialize | |
@oses = ['Debian', 'RedHat', 'Ubuntu', 'CentOS'] | |
@vars = { | |
'Debian' => { | |
'pkg' => 'apache2', | |
'apache_root' => '/var/www', | |
'user' => 'www-data', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApacheParams | |
# Define default params | |
def oses | |
@oses = ['Debian', 'RedHat', 'Ubuntu', 'CentOS'] | |
end | |
def vars | |
@vars = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):054:0> aug.match('/files/etc/ssh/sshd_config/Match[count(Condition) == "2"]/Settings/PermitRootLogin') | |
SystemCallError: unknown error - Matching path expression '/files/etc/ssh/sshd_config/Match[count(Condition) == "2"]/Settings/PermitRootLogin' failed | |
from (irb):54:in `match' | |
from (irb):54 | |
from (irb):52 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alternative Augeas-based providers for Puppet | |
# | |
# Copyright (c) 2012 Raphaël Pinson | |
# Licensed under the Apache License, Version 2.0 | |
require 'augeas' if Puppet.features.augeas? | |
Puppet::Type.type(:sshd_config).provide(:augeas) do | |
desc "Uses Augeas API to update an sshd_config parameter" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet::Type.newtype(:sshd_config) do | |
ensurable | |
newparam(:name) do | |
desc "The name of the entry." | |
isnamevar | |
end | |
newparam(:value) do | |
desc "Entry value." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"data": { | |
"output": { | |
"ensure": "0.10.0-0ubuntu4~c2c~squeeze1", | |
"status": "installed", | |
"desired": "install", | |
"provider": "apt", | |
"name": "augeas-tools", | |
"error": "ok" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ augcheck test.xml Xml | |
Test result: /tmp/augcheck.C6ia30/parse_file.aug:3.0-.47: | |
{ "str" | |
{ "#attribute" | |
{ "name" = "masterUrl" } | |
} | |
{ "#text" = "http://MY_SOLR_MASTER:8085/solr/files3/replication" } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"icon" : "http://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png", | |
"boundingbox" : [ | |
"45.3524627685547", | |
"45.9385185241699", | |
"5.62203693389893", | |
"6.298264503479" | |
], | |
"licence" : "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.", |