From fbe74fd5aef6e26070e9b10357604dda3bd2d842 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 15 Aug 2013 09:25:37 +0200 Subject: couch-doc-diff: diff of a document on the couch (feature 3485) Added the bash script couch-doc-diff. It runs a diff between the content of the couch document specified as the first parameter and the second parameter. Diff returns 0 if there is no difference. This way you can tell the data is already on the couch. The diff will ignore changes to whitespaces as these are usually irrelevant for security json docs. --- files/couch-doc-diff | 2 ++ manifests/base.pp | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 files/couch-doc-diff diff --git a/files/couch-doc-diff b/files/couch-doc-diff new file mode 100644 index 0000000..964d312 --- /dev/null +++ b/files/couch-doc-diff @@ -0,0 +1,2 @@ +#!/bin/bash +diff -w <(curl -s --netrc-file /etc/couchdb/couchdb.netrc $1 ) <(echo '$2') diff --git a/manifests/base.pp b/manifests/base.pp index fb87ae9..f1e33f1 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -32,6 +32,7 @@ class couchdb::base { } File['/usr/local/bin/couch-doc-update'] -> Couchdb::Update <| |> + File['/usr/local/bin/couch-doc-diff'] -> Couchdb::Update <| |> file { '/usr/local/bin/couch-doc-update': @@ -41,6 +42,13 @@ class couchdb::base { group => 'root', require => Package['couchrest']; + '/usr/local/bin/couch-doc-diff': + source => 'puppet:///modules/couchdb/couch-doc-diff', + mode => '0755', + owner => 'root', + group => 'root', + require => Package['couchrest']; + '/etc/couchdb/local.ini': source => [ "puppet:///modules/site_couchdb/${::fqdn}/local.ini", 'puppet:///modules/site_couchdb/local.ini', -- cgit v1.2.3