kitchen-ansible 0.50.1 → 0.51.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-ansible/version.rb +1 -1
- data/lib/kitchen/provisioner/ansible/config.rb +1 -0
- data/lib/kitchen/provisioner/ansible/os/debian.rb +1 -1
- data/lib/kitchen/provisioner/ansible/os/redhat.rb +7 -1
- data/lib/kitchen/provisioner/ansible_playbook.rb +21 -1
- data/provisioner_options.md +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74eb7dd611a7bf5dba02f9efd7958f56476036ba7d47f4801da4bf205f662ac0
|
4
|
+
data.tar.gz: 4f21d7462726ebf52fce8816c047e95450e8fcbf17bcbfc1c2821c2c09490c9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 438fa9cc8422b1da362bcfb8f61b4f2acb62ffb75400c116efbd10fa01eec3b2a2239a14a4f6fc19dfeed1b37e8530c221c2985557fbb4c7bd372e2ef76373c5
|
7
|
+
data.tar.gz: 3e34d003eca48a0577a430ddd2fd5afc084da58b239e360932b5431bd0eda327f7a19a0babaf95f6281957fede9a19079ed767216184d3cc5c6d3d29b99d92f5
|
@@ -55,6 +55,7 @@ module Kitchen
|
|
55
55
|
default_config :require_windows_support, false
|
56
56
|
default_config :require_pip, false
|
57
57
|
default_config :requirements_path, false
|
58
|
+
default_config :requirements_collection_path, false
|
58
59
|
default_config :ssh_known_hosts, nil
|
59
60
|
default_config :additional_ssh_private_keys, nil
|
60
61
|
default_config :ansible_verbose, false
|
@@ -57,7 +57,7 @@ module Kitchen
|
|
57
57
|
## 10.04, 12.04 include add-apt-repository in
|
58
58
|
if [apt-cache pkgnames | grep -q 'python-software-properties']; then
|
59
59
|
#{sudo_env('apt-get')} -y install python-software-properties
|
60
|
-
fi
|
60
|
+
fi
|
61
61
|
|
62
62
|
## 10.04 version of add-apt-repository doesn't accept --yes
|
63
63
|
## later versions require interaction from user, so we must specify --yes
|
@@ -29,7 +29,13 @@ module Kitchen
|
|
29
29
|
#{install_epel_repo}
|
30
30
|
#{redhat_yum_repo}
|
31
31
|
#{update_packages_command}
|
32
|
-
|
32
|
+
EL_RELEASE=$(rpm -E %{rhel})
|
33
|
+
|
34
|
+
if [ "${EL_RELEASE}" -lt 8 ]; then
|
35
|
+
#{sudo_env('yum')} -y install #{ansible_package_name} libselinux-python git
|
36
|
+
else
|
37
|
+
#{sudo_env('yum')} -y install #{ansible_package_name} python3-libselinux git
|
38
|
+
fi
|
33
39
|
fi
|
34
40
|
INSTALL
|
35
41
|
end
|
@@ -264,7 +264,7 @@ module Kitchen
|
|
264
264
|
end
|
265
265
|
|
266
266
|
def init_command
|
267
|
-
dirs = %w(modules roles group_vars host_vars)
|
267
|
+
dirs = %w(modules roles group_vars host_vars collections)
|
268
268
|
.map { |dir| File.join(config[:root_path], dir) }.join(' ')
|
269
269
|
cmd = "#{sudo_env('rm')} -rf #{dirs};"
|
270
270
|
cmd += " mkdir -p #{config[:root_path]}"
|
@@ -373,6 +373,10 @@ module Kitchen
|
|
373
373
|
commands << ansible_galaxy_command
|
374
374
|
end
|
375
375
|
|
376
|
+
if galaxy_requirements_collections
|
377
|
+
commands << ansible_galacy_collection_command
|
378
|
+
end
|
379
|
+
|
376
380
|
if kerberos_conf_file
|
377
381
|
commands << [
|
378
382
|
sudo_env('cp -f'), File.join(config[:root_path], 'krb5.conf'), '/etc'
|
@@ -473,6 +477,18 @@ module Kitchen
|
|
473
477
|
cmd
|
474
478
|
end
|
475
479
|
|
480
|
+
def ansible_galacy_collection_command
|
481
|
+
cmd = [
|
482
|
+
'ansible-galaxy', 'collection', 'install', '--force',
|
483
|
+
'-p', File.join(config[:root_path], 'collections'),
|
484
|
+
'-r', File.join(config[:root_path], galaxy_requirements_collections)
|
485
|
+
].join(' ')
|
486
|
+
cmd = "https_proxy=#{https_proxy} #{cmd}" if https_proxy
|
487
|
+
cmd = "http_proxy=#{http_proxy} #{cmd}" if http_proxy
|
488
|
+
cmd = "no_proxy=#{no_proxy} #{cmd}" if no_proxy
|
489
|
+
cmd
|
490
|
+
end
|
491
|
+
|
476
492
|
def cd_ansible
|
477
493
|
# this is not working so just return nil for now
|
478
494
|
# File.exist?('ansible.cfg') ? "cd #{config[:root_path]};" : nil
|
@@ -629,6 +645,10 @@ module Kitchen
|
|
629
645
|
config[:requirements_path] || nil
|
630
646
|
end
|
631
647
|
|
648
|
+
def galaxy_requirements_collections
|
649
|
+
config[:requirements_collection_path] || nil
|
650
|
+
end
|
651
|
+
|
632
652
|
def env_vars
|
633
653
|
return nil if config[:env_vars].none?
|
634
654
|
config[:env_vars].map { |k, v| "#{k}=#{v}" }.join(' ')
|
data/provisioner_options.md
CHANGED
@@ -98,6 +98,7 @@ require_pip | false | Set to `true` if Ansible is to be installed through `pip`)
|
|
98
98
|
require_ruby_for_busser | false | Install Ruby to run Busser for tests
|
99
99
|
require_windows_support | false | Install [Windows support](http://docs.ansible.com/ansible/intro_windows.html)
|
100
100
|
requirements_path | | Path to Ansible Galaxy requirements
|
101
|
+
requirements_collection_path | | Path to Ansible Galaxy requirements
|
101
102
|
retry_on_exit_code | [] | Array of exit codes to retry converge command against
|
102
103
|
role_name | | use when the repo name does not match the name the role is published as.
|
103
104
|
roles_path | roles | Ansible repo roles directory
|
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.
|
4
|
+
version: 0.51.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:
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
rubygems_version: 3.0.
|
134
|
+
rubygems_version: 3.0.3
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: ansible provisioner for test-kitchen
|