You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by sebb <se...@gmail.com> on 2017/08/04 12:23:14 UTC

Re: [whimsy] branch master updated: add scaffolding useful for testing puppet vhost macros

Thanks, v. useful!

On 3 August 2017 at 17:22,  <ru...@apache.org> wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> rubys pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/whimsy.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>      new 7e59dcb  add scaffolding useful for testing puppet vhost macros
> 7e59dcb is described below
>
> commit 7e59dcb2337fdf0eaff91c877d6904dc0397c1c9
> Author: Sam Ruby <ru...@intertwingly.net>
> AuthorDate: Thu Aug 3 12:21:33 2017 -0400
>
>     add scaffolding useful for testing puppet vhost macros
> ---
>  tools/vhosttest.rb | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/tools/vhosttest.rb b/tools/vhosttest.rb
> new file mode 100644
> index 0000000..937d917
> --- /dev/null
> +++ b/tools/vhosttest.rb
> @@ -0,0 +1,27 @@
> +#
> +# Scaffolding needed to test infrastructure-puppet/modules/vhosts_whimsy/...
> +# preprocess_vhosts.rb puppet macro
> +#
> +
> +require 'whimsy/asf'
> +
> +IP = ASF::Git['infrastructure-puppet']
> +
> +module Puppet
> +  module Parser
> +    module Functions
> +      def self.newfunction(*args)
> +      end
> +    end
> +  end
> +end
> +
> +require 'yaml'
> +require "#{IP}/modules/vhosts_whimsy/lib/puppet/parser/functions/preprocess_vhosts.rb"
> +
> +facts = YAML.load_file("#{IP}//data/nodes/whimsy-vm3.apache.org.yaml")
> +facts = facts['vhosts_whimsy::vhosts::vhosts']['whimsy-vm-443']
> +ldap = ASF::LDAP.hosts.sort.first
> +
> +macros = Puppet::Parser::Functions::ApacheVHostMacros.new(facts, ldap)
> +puts macros.result['custom_fragment']
>
> --
> To stop receiving notification emails like this one, please contact
> ['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].