kitchen-ansible 0.40.1 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2da321129b9d2bddb85702ed6a61e8fdd7789b20
4
- data.tar.gz: 630edeac9b8a0d9150215e433ce062ee3e638ed4
3
+ metadata.gz: c49ee3c2a66571122b0b5f9f9a275ee76ac531ec
4
+ data.tar.gz: 538a482c315ee52137a0967099d4aaebcbb0231f
5
5
  SHA512:
6
- metadata.gz: 27d52967de43e07a633f3dd66f85e353561ed87ff62c3f8b2809f79fc10813b3d373322e500fdaf925686147c82923c3b94d10b421e85482dd6fd4df95a42bdf
7
- data.tar.gz: 985d2162e32ea7b62023daf1e870ddeca7bbf6f0305bef65087d01f2112d4117b764bdbc2999827550ee390e83d05a5774470d0d394fe963071b49d41bb1a757
6
+ metadata.gz: 99fbcd27f38933982f2178cb5fd180db04cedd3b037156b2b53fa3f654f6e291a604e1a61ada3983ca36fa7ffd1b61ae087b0d4fc3c19d54c1257e5cfb84dd5a
7
+ data.tar.gz: 40da82b0882a67494a6c2c51a7d365fe0a5767a0f10620371d7a311043ffaad371708769ad91016befcf845ee6e7df3de3ab7a999881bf1ff9c0db9544764b9b
data/README.md CHANGED
@@ -56,7 +56,7 @@ platforms:
56
56
 
57
57
  ## Test-Kitchen Ansible Windows Support
58
58
 
59
- Windows is supported by created a lunix server to run ansible with software required to support winrm. Then winrm connection is used to configure the windows server.
59
+ Windows is supported by creating a linux server to run ansible with software required to support winrm. Then the winrm connection is used to configure the windows server.
60
60
 
61
61
  In kitchen.yml set
62
62
 
@@ -66,7 +66,7 @@ In kitchen.yml set
66
66
  require_chef_for_busser: false
67
67
  ```
68
68
 
69
- See example [https://github.com/neillturner/ansible_windows_repo](https://github.com/neillturner/ansible_windows_repo)
69
+ See example [https://github.com/neillturner/ansible_windows_repo](https://github.com/neillturner/ansible_windows_repo).
70
70
 
71
71
 
72
72
  ## Ruby install to run serverspec verify
@@ -105,14 +105,12 @@ Please see the [Provisioner Options](https://github.com/neillturner/kitchen-ansi
105
105
 
106
106
  ## Test-Kitchen Ansiblespec
107
107
 
108
- By using kitchen-verifier-serverspec and the Runner ansiblespec_runner tests can be against multiple servers with multiple roles in the ansiblespec format.
108
+ By using kitchen-verifier-serverspec and the Runner ansiblespec_runner tests can be run against multiple servers with multiple roles in the ansiblespec format.
109
109
 
110
110
  Serverspec uses ssh to communicate with the server to be tested and reads the ansible playbook and inventory files to determine the hosts to test and the roles for each host.
111
111
 
112
112
  See example [https://github.com/neillturner/ansible_repo](https://github.com/neillturner/ansible_repo)
113
113
 
114
-
115
-
116
114
  ### Example usage to create tomcat servers:
117
115
 
118
116
  ![test-kitchen, ansible and ansiblespec](https://github.com/neillturner/ansible_repo/blob/master/kitchen-ansible.png "test-kitchen, ansible and ansiblespec")
@@ -32,4 +32,9 @@ EOF
32
32
  s.add_development_dependency 'pry'
33
33
  s.add_development_dependency 'rake'
34
34
  s.add_runtime_dependency 'librarian-ansible'
35
+ if RUBY_VERSION >= '2.0'
36
+ s.add_dependency 'net-ssh', '~> 3.0'
37
+ else
38
+ s.add_dependency 'net-ssh', '~> 2.9'
39
+ end
35
40
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module Kitchen
3
3
  module Ansible
4
- VERSION = '0.40.1'
4
+ VERSION = '0.41.0'
5
5
  end
6
6
  end
@@ -28,7 +28,7 @@ module Kitchen
28
28
  if [ ! $(which ansible) ]; then
29
29
  #{install_epel_repo}
30
30
  #{sudo_env('yum-config-manager')} --enable epel/x86_64
31
- #{sudo_env('yum')} -y install ansible#{ansible_redhat_version} git
31
+ #{sudo_env('yum')} -y install #{ansible_package_name} git
32
32
  #{sudo_env('alternatives')} --set python /usr/bin/python2.6
33
33
  #{sudo_env('yum')} clean all
34
34
  #{sudo_env('yum')} install yum-python26 -y
@@ -29,7 +29,7 @@ module Kitchen
29
29
  #{install_epel_repo}
30
30
  #{redhat_yum_repo}
31
31
  #{update_packages_command}
32
- #{sudo_env('yum')} -y install ansible#{ansible_redhat_version} libselinux-python git
32
+ #{sudo_env('yum')} -y install #{ansible_package_name} libselinux-python git
33
33
  fi
34
34
  INSTALL
35
35
  end
@@ -42,8 +42,12 @@ module Kitchen
42
42
  @config[:enable_yum_epel] ? sudo_env('yum install epel-release -y') : nil
43
43
  end
44
44
 
45
- def ansible_redhat_version
46
- @config[:ansible_version] ? "-#{@config[:ansible_version]}" : nil
45
+ def ansible_package_name
46
+ if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
47
+ "ansible"
48
+ else
49
+ "ansible-#{@config[:ansible_version]}"
50
+ end
47
51
  end
48
52
 
49
53
  def redhat_yum_repo
@@ -184,6 +184,13 @@ module Kitchen
184
184
  PACKAGES="ruby ruby-dev ruby2.1 ruby2.1-dev"
185
185
  fi
186
186
  fi
187
+ if [ "$(lsb_release -si)" = "Ubuntu" ]; then
188
+ ubuntuvers=$(lsb_release -sr | tr -d .)
189
+ if [ $ubuntuvers -ge 1410 ]; then
190
+ # Default ruby is 2.x in utopic and newer
191
+ PACKAGES="ruby ruby-dev ruby2.1 ruby2.1-dev"
192
+ fi
193
+ fi
187
194
  #{sudo_env('apt-get')} -y install $PACKAGES
188
195
  if [ $debvers -eq 6 ]; then
189
196
  # in squeeze we need to update alternatives
@@ -354,7 +361,7 @@ module Kitchen
354
361
  cmd,
355
362
  ansible_inventory_flag,
356
363
  ansible_limit_flag,
357
- "-c #{config[:ansible_connection]}",
364
+ ansible_connection_flag,
358
365
  "-M #{File.join(config[:root_path], 'modules')}",
359
366
  ansible_verbose_flag,
360
367
  ansible_check_flag,
@@ -563,6 +570,7 @@ module Kitchen
563
570
  end
564
571
 
565
572
  def ansible_inventory
573
+ return nil if config[:ansible_inventory] == 'none'
566
574
  config[:ansible_inventory] = config[:ansible_inventory_file] if config[:ansible_inventory].nil?
567
575
  info('ansible_inventory_file parameter deprecated use ansible_inventory') if config[:ansible_inventory_file]
568
576
  config[:ansible_inventory]
@@ -572,6 +580,10 @@ module Kitchen
572
580
  config[:ansible_version] ? "=#{config[:ansible_version]}" : nil
573
581
  end
574
582
 
583
+ def ansible_connection_flag
584
+ "-c #{config[:ansible_connection]}" if config[:ansible_connection] != 'none'
585
+ end
586
+
575
587
  def ansible_verbose_flag
576
588
  config[:ansible_verbose] ? '-' << ('v' * verbosity_level(config[:ansible_verbosity])) : nil
577
589
  end
@@ -590,7 +602,8 @@ module Kitchen
590
602
  end
591
603
 
592
604
  def ansible_inventory_flag
593
- config[:ansible_inventory] ? "-i #{File.join(config[:root_path], File.basename(config[:ansible_inventory]))}" : "-i #{File.join(config[:root_path], 'hosts')}"
605
+ return nil if config[:ansible_inventory] == 'none'
606
+ ansible_inventory ? "-i #{File.join(config[:root_path], File.basename(ansible_inventory))}" : "-i #{File.join(config[:root_path], 'hosts')}"
594
607
  end
595
608
 
596
609
  def ansible_limit_flag
@@ -22,10 +22,10 @@ no_proxy | nil | list of URLs or IPs that should be excluded from proxying
22
22
  roles_path | roles | ansible repo roles directory
23
23
  group_vars_path | group_vars | ansible repo group_vars directory
24
24
  host_vars_path | host_vars | ansible repo hosts directory
25
- library_plugins | library | ansible repo library plugins directory
26
- callback_plugins | callback_plugins | ansible repo callback_plugins directory
27
- filter_plugins | filter_plugins | ansible repo filter_plugins directory
28
- lookup_plugins | lookup_plugins | ansible repo lookup_plugins directory
25
+ library_plugins_path | library | ansible repo library plugins directory
26
+ callback_plugins_path | callback_plugins | ansible repo callback_plugins directory
27
+ filter_plugins_path | filter_plugins | ansible repo filter_plugins directory
28
+ lookup_plugins_path | lookup_plugins | ansible repo lookup_plugins directory
29
29
  additional_copy_path | | arbitrary array of files and directories to copy into test environment, relative to CWD. (eg, vars or included playbooks)
30
30
  extra_vars | Hash.new | Hash to set the extra_vars passed to ansibile-playbook command
31
31
  playbook | 'default.yml' | playbook for ansible-playbook to run
@@ -38,9 +38,9 @@ update_package_repos| true| update OS repository metadata
38
38
  ansiblefile_path | | Path to Ansiblefile
39
39
  requirements_path | | Path to ansible-galaxy requirements
40
40
  ansible_vault_password_file| | Path of Ansible Vault Password File
41
- ansible_connection | local | use 'ssh' if host not localhost
41
+ ansible_connection | local | use 'ssh' if host not localhost or 'winrm' for windows or 'none' if defined in inventory.
42
42
  hosts | | create ansible hosts file for localhost with this server group
43
- ansible_inventory | | Static or dynamic inventory file or directory.
43
+ ansible_inventory | | Static or dynamic inventory file or directory or 'none' if defined in ansible.cfg.
44
44
  ansible_limit | | Further limits the selected host/group patterns.
45
45
  ansible_extra_flags | | Additional options to pass to `ansible-playbook` -- e.g.: `'--skip-tags=redis'`
46
46
  ansible_playbook_command | | Override the ansible playbook command
@@ -54,7 +54,7 @@ private_key | | ssh private key file for ssh connection
54
54
  idempotency_test | false | Enable to test ansible playbook idempotency
55
55
  ssh_known_hosts | | List of hosts that should be added to `~/.ssh/known_hosts`
56
56
  kerberos_conf_file| | Path of krb5.conf file using in windows support
57
- require_windows_support | false | install windows support: http://docs.ansible.com/ansible/intro_windows.html
57
+ require_windows_support | false | install windows support: http://docs.ansible.com/ansible/intro_windows.html
58
58
 
59
59
  ## Configuring Provisioner Options
60
60
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.40.1
4
+ version: 0.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-19 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: net-ssh
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
83
97
  description: |+
84
98
  == DESCRIPTION:
85
99