Skip to content

Instantly share code, notes, and snippets.

View raphink's full-sized avatar
🐝
eBPF everything!

Raphaël Pinson raphink

🐝
eBPF everything!
View GitHub Profile
#!/bin/bash
REF="$1"
VERSION="$2"
FILE="$3"
VERSE=$(diatheke -b "$VERSION" -k "$REF" | \
head -n -1 | \
sed -e 's/^[^:]\+ [0-9:]\+:[ \t\n]*//' | \
$ augparse trafficserver_ssl_multicert.aug
Test result: trafficserver_ssl_multicert.aug:18.0-23.4:
{ "#comment" = "Examples:" }
{ "1"
{ "ssl_cert_name" = "foo.pem" }
}
{ "2"
{ "dest_ip" = "*" }
{ "ssl_cert_name" = "bar.pem" }
{ "ssl_key_name" = "barKey.pem" }
ssl_cert_name=foo.pem
dest_ip=* ssl_cert_name=bar.pem ssl_key_name=barKey.pem
becomes
1/ssl_cert_name = 'foo.pem'
2/dest_ip = '*'
2/ssl_cert_name = 'bar.pem'
2/ssl_key_name = 'barKey.pem'
$ gem list
*** LOCAL GEMS ***
bundler (1.3.4)
diff-lcs (1.2.1, 1.1.3)
facter (1.6.18, 1.6.16, 1.6.13)
hiera (1.1.2, 1.0.0)
json (1.7.7, 1.7.5)
json_pure (1.7.7)
rpinson@wrk4:~/dev/puppet-augeasproviders$ bundle exec rake
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
rake build # Build puppet module package
rake clean # Clean a built module package
rake coverage # Generate code coverage information
rake help # Display the list of available rake tasks
rake lint # Check puppet manifests with puppet-lint
rake spec # Run spec tests in a clean fixtures directory
rake spec_clean # Clean up the fixtures directory
exec { 'apt-get clean':
unless => "mount | grep -q ${apt_archives_dir}",
before => Mount[$apt_archives_dir],
}
mount { $apt_archives_dir:
ensure => 'mounted',
device => 'tmpfs',
fstype => 'tmpfs',
options => $apt_archives_options,
# yum install augeas-devel
Loaded plugins: downloadonly, product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package augeas-devel.x86_64 0:0.9.0-4.el6 will be installed
--> Processing Dependency: augeas-libs = 0.9.0-4.el6 for package: augeas-devel-0.9.0-4.el6.x86_64
--> Running transaction check
rpinson@wrk4:~/bas/puppet/augeas$ cat /etc/fstab
# HEADER: This file was autogenerated at Tue Mar 13 13:29:32 +0100 2012
# HEADER: by puppet. While it can still be managed manually, it
# HEADER: is definitely not recommended.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
rpinson@wrk4:~/bas/puppet/augeas$ ls
fakemodule puppet-stdlib
rpinson@wrk4:~/bas/puppet/augeas$ cat fakemodule/manifests/init.pp
class fakemodule {
notify { 'foo':
message => augeas("proc /proc proc nodev,noexec,nosuid 0 0\n", 'Fstab.lns', ['rm ./1/opt[3]']),
}
}
rpinson@wrk4:~/bas/puppet/augeas$ RUBYLIB=/var/lib/gems/1.8/gems/ruby-augeas-0.4.1/lib puppet apply -e 'include fakemodule' --modulepath .
notice: proc /proc proc nodev,noexec 0 0
$ rake package --trace
rake aborted!
GONE
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:191:in `deprecate'
/usr/lib/ruby/vendor_ruby/rake/rdoctask.rb:4
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/rpinson/dev/ruby-augeas/Rakefile:12
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load_rakefile'