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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12f00ffe0cf6ec8436074b5fffcfbf108a8b382a6f5b0ea916214bbc139a8994
4
- data.tar.gz: 5ccb79c952524c5dc2388a89459b8c3c0b2265a9cf4f0fc4b534b3e1008efb4c
3
+ metadata.gz: 74eb7dd611a7bf5dba02f9efd7958f56476036ba7d47f4801da4bf205f662ac0
4
+ data.tar.gz: 4f21d7462726ebf52fce8816c047e95450e8fcbf17bcbfc1c2821c2c09490c9b
5
5
  SHA512:
6
- metadata.gz: 8d8b98e8cc45cf4f18c4b291af31e8dea39748ef0a1110af663508eb9714f82e0f4f7c14cdad2d60bed6e2600b84da51a2b57c43fa12187c090dccf4fefd7f6f
7
- data.tar.gz: 4c9cfc4c83fe4a99bbf86cca8c0a1cd69dfea00838b9a5df2bbe056e3f6c22c3dcea3daaa7babf885c8fd5b09eb1372e666b1bba9938f868b92078313df362ee
6
+ metadata.gz: 438fa9cc8422b1da362bcfb8f61b4f2acb62ffb75400c116efbd10fa01eec3b2a2239a14a4f6fc19dfeed1b37e8530c221c2985557fbb4c7bd372e2ef76373c5
7
+ data.tar.gz: 3e34d003eca48a0577a430ddd2fd5afc084da58b239e360932b5431bd0eda327f7a19a0babaf95f6281957fede9a19079ed767216184d3cc5c6d3d29b99d92f5
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module Kitchen
3
3
  module Ansible
4
- VERSION = '0.50.1'.freeze
4
+ VERSION = '0.51.0'.freeze
5
5
  end
6
6
  end
@@ -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
- #{sudo_env('yum')} -y install #{ansible_package_name} libselinux-python git
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(' ')
@@ -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.50.1
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: 2019-07-23 00:00:00.000000000 Z
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.1
134
+ rubygems_version: 3.0.3
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: ansible provisioner for test-kitchen