kitchen-ansible 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # kitchen-ansible
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/kitchen-ansible.svg)](http://badge.fury.io/rb/kitchen-ansible)
4
+
2
5
  A Test Kitchen Provisioner for Ansible
3
6
 
4
7
  The provider works by passing the ansible repository based on attributes in .kitchen.yml & calling ansible-playbook.
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Ansible
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
@@ -81,6 +81,10 @@ module Kitchen
81
81
  provisioner.calculate_path('Ansiblefile', :file)
82
82
  end
83
83
 
84
+ default_config :filter_plugins_path do |provisioner|
85
+ provisioner.calculate_path('filter_plugins', :directory)
86
+ end
87
+
84
88
  default_config :requirements_path, false
85
89
  default_config :ansible_verbose, false
86
90
  default_config :ansible_verbosity, 1
@@ -271,6 +275,7 @@ module Kitchen
271
275
  prepare_addt_dir
272
276
  prepare_host_vars
273
277
  prepare_hosts
278
+ prepare_filter_plugins
274
279
  info('Finished Preparing files for transfer')
275
280
 
276
281
  end
@@ -353,6 +358,10 @@ module Kitchen
353
358
  File.join(sandbox_path, 'roles')
354
359
  end
355
360
 
361
+ def tmp_filter_plugins_dir
362
+ File.join(sandbox_path, 'filter_plugins')
363
+ end
364
+
356
365
  def ansiblefile
357
366
  config[:ansiblefile_path] || ''
358
367
  end
@@ -392,6 +401,11 @@ module Kitchen
392
401
  def host_vars
393
402
  config[:host_vars_path].to_s
394
403
  end
404
+
405
+ def filter_plugins
406
+ config[:filter_plugins_path].to_s
407
+ end
408
+
395
409
 
396
410
  def ansible_debian_version
397
411
  config[:ansible_version] ? "=#{config[:ansible_version]}" : nil
@@ -577,6 +591,18 @@ module Kitchen
577
591
  end
578
592
  end
579
593
 
594
+ def prepare_filter_plugins
595
+ info('Preparing filter_plugins')
596
+ FileUtils.mkdir_p(tmp_filter_plugins_dir)
597
+
598
+ if filter_plugins && File.directory?(filter_plugins)
599
+ debug("Using filter_plugins from #{filter_plugins}")
600
+ FileUtils.cp_r(Dir.glob("#{filter_plugins}/*.py"), tmp_filter_plugins_dir, remove_destination: true)
601
+ else
602
+ info 'nothing to do for filter_plugins'
603
+ end
604
+ end
605
+
580
606
  def resolve_with_librarian
581
607
  Kitchen.mutex.synchronize do
582
608
  Ansible::Librarian.new(ansiblefile, tmp_roles_dir, logger).resolve
@@ -14,6 +14,7 @@ ansible_omnibus_remote_path | "/opt/ansible" | Server Installation location of a
14
14
  roles_path | roles | ansible repo roles directory
15
15
  group_vars_path | group_vars | ansible repo group_vars directory
16
16
  host_vars_path | host_vars | ansible repo hosts directory
17
+ filter_plugins | filter_plugins | ansible repo filter_plugins directory
17
18
  additional_copy_path | | arbitrary directory to copy into test environment, relative to CWD. (eg, vars)
18
19
  extra_vars | Hash.new | Hash to set the extra_vars passed to ansibile-playbook command
19
20
  playbook | 'site.yml' | playbook for ansible-playbook to run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-22 00:00:00.000000000 Z
12
+ date: 2015-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen