kitchen-ansible 0.0.5 → 0.0.6

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.
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Ansible
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -46,6 +46,7 @@ module Kitchen
46
46
  default_config :ansible_version, nil
47
47
  default_config :require_ansible_repo, true
48
48
  default_config :extra_vars, {}
49
+ default_config :tags, []
49
50
  default_config :ansible_apt_repo, "ppa:ansible/ansible"
50
51
  default_config :ansible_yum_repo, "https://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm"
51
52
  default_config :chef_bootstrap_url, "https://www.getchef.com/chef/install.sh"
@@ -309,6 +310,7 @@ module Kitchen
309
310
  ansible_verbose_flag,
310
311
  ansible_check_flag,
311
312
  extra_vars,
313
+ tags,
312
314
  "#{File.join(config[:root_path], File.basename(config[:playbook]))}",
313
315
  ].join(" ")
314
316
  end
@@ -403,13 +405,28 @@ module Kitchen
403
405
  end
404
406
 
405
407
  def extra_vars
406
- return nil if config[:extra_vars].none?
407
- bash_vars = JSON.dump(config[:extra_vars])
408
+ bash_vars = config[:extra_vars]
409
+ if config.key?(:attributes) && config[:attributes].key?(:extra_vars) && config[:attributes][:extra_vars].is_a?(Hash)
410
+ bash_vars = config[:attributes][:extra_vars]
411
+ end
412
+
413
+ return nil if bash_vars.none?
414
+ bash_vars = JSON.dump(bash_vars)
408
415
  bash_vars = "-e '#{bash_vars}'"
409
416
  debug(bash_vars)
410
417
  bash_vars
411
418
  end
412
419
 
420
+ def tags
421
+ bash_tags = config.key?(:attributes) && config[:attributes].key?(:tags) && config[:attributes][:tags].is_a?(Array) ? config[:attributes][:tags] : config[:tags]
422
+ return nil if bash_tags.empty?
423
+
424
+ bash_tags = bash_tags.join(",")
425
+ bash_tags = "-t '#{bash_tags}'"
426
+ debug(bash_tags)
427
+ bash_tags
428
+ end
429
+
413
430
  def ansible_apt_repo
414
431
  config[:ansible_apt_repo]
415
432
  end
@@ -6,7 +6,7 @@ key | default value | Notes
6
6
  ansible_version | "latest"| desired version, affects apt installs
7
7
  ansible_platform | naively tries to determine | OS platform of server
8
8
  require_ansible_repo | true | Set if using a ansible install from yum or apt repo
9
- ansible_apt_repo | "ppa:rquillo/ansible"| apt repo
9
+ ansible_apt_repo | "ppa:ansible/ansible"| apt repo
10
10
  ansible_yum_repo | "https://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm"| yum repo
11
11
  require_ansible_omnibus | false | Set if using omnibus ansible install
12
12
  ansible_omnibus_url | | omnibus ansible install location.
@@ -53,11 +53,16 @@ The provisioner can be configured globally or per suite, global settings act as
53
53
 
54
54
  in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the latest ansible and ansible playbook against a ansible repo from the /repository/ansible_repo directory using the defailt manifest site.yml
55
55
 
56
- To override a setting at the suite-level, specify the setting name under the suite:
56
+ To override a setting at the suite-level, specify the setting name under the suite's attributes:
57
57
 
58
58
  suites:
59
- - name: default
60
- playbook: foobar.yml
59
+ - name: server
60
+ attributes:
61
+ extra_vars:
62
+ server_installer_url: http://downloads.app.com/v1.0
63
+ tags:
64
+ - server
65
+
61
66
 
62
67
  ### Per-suite Structure
63
68
 
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.5
4
+ version: 0.0.6
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-01-05 00:00:00.000000000 Z
12
+ date: 2015-01-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! '== DESCRIPTION:
15
15