kitchen-ansible 0.0.38 → 0.0.39
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc8e839edd7ff2c945b63d651c20c51abd0e7135
|
|
4
|
+
data.tar.gz: a2be99ad62a1cb475f4c4f89e80b5976a79960b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a66511b709d9a166ae14633d620f7f8d04ff6572308d41d19d991a5ffb1d6faf0abe04f134f01bd109d3ecfb9f94a1dbcc54b22f388ae3c682ad3e88d794697
|
|
7
|
+
data.tar.gz: 63aca35e02d85e9d8b902c01e472d58da63388f672b62cae9465e28bec04b26f45615297775679844d111fc63717e76c359a97bcb4397a3021d0282242715a41
|
|
@@ -66,6 +66,9 @@ module Kitchen
|
|
|
66
66
|
default_config :ansible_playbook_command, nil
|
|
67
67
|
default_config :ansible_host_key_checking, true
|
|
68
68
|
default_config :idempotency_test, nil
|
|
69
|
+
default_config :ansible_inventory, nil
|
|
70
|
+
default_config :ansible_inventory_file, nil
|
|
71
|
+
default_config :ansible_limit, nil
|
|
69
72
|
|
|
70
73
|
default_config :playbook do |provisioner|
|
|
71
74
|
provisioner.calculate_path('default.yml', :file) ||
|
|
@@ -117,10 +120,6 @@ module Kitchen
|
|
|
117
120
|
provisioner.calculate_path('ansible-vault-password', :file)
|
|
118
121
|
end
|
|
119
122
|
|
|
120
|
-
default_config :ansible_inventory_file do |provisioner|
|
|
121
|
-
provisioner.calculate_path('hosts', :file)
|
|
122
|
-
end
|
|
123
|
-
|
|
124
123
|
def initialize(config = {})
|
|
125
124
|
init_config(config)
|
|
126
125
|
end
|
|
@@ -207,7 +207,7 @@ module Kitchen
|
|
|
207
207
|
yield if block_given?
|
|
208
208
|
|
|
209
209
|
prepare_playbook
|
|
210
|
-
|
|
210
|
+
prepare_inventory
|
|
211
211
|
prepare_modules
|
|
212
212
|
prepare_roles
|
|
213
213
|
prepare_ansible_cfg
|
|
@@ -257,6 +257,27 @@ module Kitchen
|
|
|
257
257
|
end
|
|
258
258
|
end
|
|
259
259
|
|
|
260
|
+
if ansible_inventory
|
|
261
|
+
if File.directory?(ansible_inventory)
|
|
262
|
+
Dir.foreach(ansible_inventory) do |f|
|
|
263
|
+
next if f == "." or f == ".."
|
|
264
|
+
contents = File.open("#{ansible_inventory}/#{f}", 'rb') { |g| g.read }
|
|
265
|
+
if contents.start_with?('#!')
|
|
266
|
+
commands << [
|
|
267
|
+
sudo_env('chmod +x'), File.join("#{config[:root_path]}/#{File.basename(ansible_inventory)}", File.basename(f))
|
|
268
|
+
].join(' ')
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
else
|
|
272
|
+
contents = File.open(ansible_inventory, 'rb') { |f| f.read }
|
|
273
|
+
if contents.start_with?('#!')
|
|
274
|
+
commands << [
|
|
275
|
+
sudo_env('chmod +x'), File.join(config[:root_path], File.basename(ansible_inventory))
|
|
276
|
+
].join(' ')
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
260
281
|
if galaxy_requirements
|
|
261
282
|
if config[:require_ansible_source]
|
|
262
283
|
commands << setup_ansible_env_from_source
|
|
@@ -300,6 +321,7 @@ module Kitchen
|
|
|
300
321
|
result = [
|
|
301
322
|
cmd,
|
|
302
323
|
ansible_inventory_flag,
|
|
324
|
+
ansible_limit_flag,
|
|
303
325
|
"-c #{config[:ansible_connection]}",
|
|
304
326
|
"-M #{File.join(config[:root_path], 'modules')}",
|
|
305
327
|
ansible_verbose_flag,
|
|
@@ -436,8 +458,8 @@ module Kitchen
|
|
|
436
458
|
File.join(sandbox_path, File.basename(ansible_vault_password_file).reverse.chomp('.').reverse)
|
|
437
459
|
end
|
|
438
460
|
|
|
439
|
-
def
|
|
440
|
-
File.join(sandbox_path, File.basename(
|
|
461
|
+
def tmp_inventory_path
|
|
462
|
+
File.join(sandbox_path, File.basename(ansible_inventory))
|
|
441
463
|
end
|
|
442
464
|
|
|
443
465
|
def ansiblefile
|
|
@@ -504,8 +526,14 @@ module Kitchen
|
|
|
504
526
|
config[:ansible_vault_password_file]
|
|
505
527
|
end
|
|
506
528
|
|
|
507
|
-
def
|
|
508
|
-
config[:ansible_inventory_file]
|
|
529
|
+
def ansible_inventory
|
|
530
|
+
config[:ansible_inventory] = config[:ansible_inventory_file] if config[:ansible_inventory].nil?
|
|
531
|
+
info('ansible_inventory_file parameter deprecated use ansible_inventory') if config[:ansible_inventory_file]
|
|
532
|
+
config[:ansible_inventory]
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
def ansible_debian_version
|
|
536
|
+
config[:ansible_version] ? "=#{config[:ansible_version]}" : nil
|
|
509
537
|
end
|
|
510
538
|
|
|
511
539
|
def ansible_verbose_flag
|
|
@@ -526,7 +554,11 @@ module Kitchen
|
|
|
526
554
|
end
|
|
527
555
|
|
|
528
556
|
def ansible_inventory_flag
|
|
529
|
-
config[:
|
|
557
|
+
config[:ansible_inventory] ? "-i #{File.join(config[:root_path], File.basename(config[:ansible_inventory]))}" : "-i #{File.join(config[:root_path], 'hosts')}"
|
|
558
|
+
end
|
|
559
|
+
|
|
560
|
+
def ansible_limit_flag
|
|
561
|
+
config[:ansible_limit] ? "-l #{config[:ansible_limit]}" : ""
|
|
530
562
|
end
|
|
531
563
|
|
|
532
564
|
def ansible_extra_flags
|
|
@@ -693,19 +725,23 @@ module Kitchen
|
|
|
693
725
|
end
|
|
694
726
|
end
|
|
695
727
|
|
|
696
|
-
def
|
|
697
|
-
info('Preparing inventory
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
728
|
+
def prepare_inventory
|
|
729
|
+
info('Preparing inventory')
|
|
730
|
+
return unless ansible_inventory
|
|
731
|
+
if File.directory?(ansible_inventory)
|
|
732
|
+
debug("Copying inventory directory from #{ansible_inventory} to #{tmp_inventory_path}")
|
|
733
|
+
FileUtils.cp_r(ansible_inventory, sandbox_path)
|
|
734
|
+
else
|
|
735
|
+
debug("Copying inventory file from #{ansible_inventory} to #{tmp_inventory_path}")
|
|
736
|
+
FileUtils.cp_r(ansible_inventory, tmp_inventory_path)
|
|
737
|
+
end
|
|
702
738
|
end
|
|
703
739
|
|
|
704
740
|
# localhost ansible_connection=local
|
|
705
741
|
# [example_servers]
|
|
706
742
|
# localhost
|
|
707
743
|
def prepare_hosts
|
|
708
|
-
return if
|
|
744
|
+
return if ansible_inventory
|
|
709
745
|
info('Preparing hosts file')
|
|
710
746
|
|
|
711
747
|
if config[:hosts].nil?
|
data/provisioner_options.md
CHANGED
|
@@ -39,8 +39,10 @@ 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
41
|
ansible_connection | local | use 'ssh' if host not localhost
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
hosts | | create ansible hosts file for localhost with this server group
|
|
43
|
+
ansible_inventory | | Static or dynamic inventory file or directory.
|
|
44
|
+
ansible_limit | | Further limits the selected host/group patterns.
|
|
45
|
+
ansible_extra_flags | | Additional options to pass to `ansible-playbook` -- e.g.: `'--skip-tags=redis'`
|
|
44
46
|
ansible_playbook_command | | Override the ansible playbook command
|
|
45
47
|
require_ruby_for_busser|false|install ruby to run busser for tests
|
|
46
48
|
require_chef_for_busser|true|install chef to run busser for tests. NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
|
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.0.
|
|
4
|
+
version: 0.0.39
|
|
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-
|
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: test-kitchen
|