kitchen-ansible 0.46.4 → 0.47.0

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: 87e37287168010d760b9011c4563626769900a6d
4
- data.tar.gz: 1b0903cf20c7f7b9178a4c6452351cb3da8e3dcf
3
+ metadata.gz: 68789a1bc8b78cc0f7823a8fc37550b3380cce3e
4
+ data.tar.gz: a9c91817f79f0c2c2dd70eb7315b6b34e4dcc24a
5
5
  SHA512:
6
- metadata.gz: a5a9c542115bfe96333bf757d01058cc97226c417d9e95bcf7f938758745381a7a21656ea5944cbbee42b7f29983357a7e04fa59f5def135262d6a49e11bfbf7
7
- data.tar.gz: 94238d5b1cbe84153890fe692457e81e5a2de50e47f59e42512f15edd7bd0dad078e257d963c921da216a1b66401c86ee01e4e17f45ce5db897b8ad5123e284a
6
+ metadata.gz: 1bc3691dd665a8d8bdc14ca4f95d8319972614bcb22a2ba91cef6379beffdca495fd020287671ee66451af0e5ec024618c872dcb2152b55ce78bdb76a115b7e7
7
+ data.tar.gz: 0513eac5a974766edb118bedfa2da1535960a2d2303ad79961cd8f5560d7509ff3468f58db6c23282705a35f504edc3de64661966641af087e40068071c62671
@@ -112,24 +112,35 @@ module Kitchen
112
112
  result
113
113
  end
114
114
 
115
+ def detect_debug
116
+ if ARGV.include? 'debug'
117
+ result = "1"
118
+ else
119
+ result = "/dev/null"
120
+ end
121
+ return result
122
+ end
123
+
115
124
  def install_windows_support
116
125
  install = ''
117
126
  if require_windows_support
118
- install << <<-INSTALL
119
- if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
120
- #{sudo_env('yum')} -y install python-devel krb5-devel krb5-libs krb5-workstation gcc
121
- else
122
- if [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
123
- #{sudo_env('zypper')} ar #{python_sles_repo}
124
- #{sudo_env('zypper')} --non-interactive install python python-devel krb5-client pam_krb5
125
- else
126
- #{sudo_env('apt-get')} -y install python-dev libkrb5-dev build-essential
127
- fi
128
- fi
129
- #{export_http_proxy}
130
- #{sudo_env('easy_install')} pip
131
- #{sudo_env('pip')} install pywinrm kerberos
132
- INSTALL
127
+ info ("Installing Windows Support")
128
+ info ("Installing pip")
129
+ install << <<-INSTALL
130
+ if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
131
+ #{sudo_env('yum')} -y install python-devel krb5-devel krb5-libs krb5-workstation gcc > #{detect_debug}
132
+ else
133
+ if [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
134
+ #{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
135
+ #{sudo_env('zypper')} --non-interactive install python python-devel krb5-client pam_krb5 > #{detect_debug}
136
+ else
137
+ #{sudo_env('apt-get')} -y install python-dev libkrb5-dev build-essential > #{detect_debug}
138
+ fi
139
+ fi
140
+ #{export_http_proxy}
141
+ #{sudo_env('easy_install')} pip > #{detect_debug}
142
+ #{sudo_env('pip')} install pywinrm kerberos > #{detect_debug}
143
+ INSTALL
133
144
  end
134
145
  install
135
146
  end
@@ -156,9 +167,9 @@ module Kitchen
156
167
  if [ -n "$rhelversion6" ] || [ -n "$rhelversion7" ]; then
157
168
  if [ ! -d "/opt/rh/ruby200" ]; then
158
169
  echo "-----> Installing ruby200 SCL in CentOS6/CentOS7/RHEL6/RHEL7 to install busser to run tests"
159
- #{sudo_env('yum')} install -y centos-release-scl
160
- #{sudo_env('yum')} install -y ruby200
161
- #{sudo_env('yum')} install -y ruby200-ruby-devel
170
+ #{sudo_env('yum')} install -y centos-release-scl > #{detect_debug}
171
+ #{sudo_env('yum')} install -y ruby200 > #{detect_debug}
172
+ #{sudo_env('yum')} install -y ruby200-ruby-devel > #{detect_debug}
162
173
  echo "-----> Enabling ruby200"
163
174
  source /opt/rh/ruby200/enable
164
175
  echo "/opt/rh/ruby200/root/usr/lib64" | sudo tee -a /etc/ld.so.conf
@@ -168,21 +179,21 @@ module Kitchen
168
179
  fi
169
180
  else
170
181
  if [ ! $(which ruby) ]; then
171
- #{update_packages_redhat_cmd}
172
- #{sudo_env('yum')} -y install ruby ruby-devel
182
+ #{update_packages_redhat_cmd} > #{detect_debug}
183
+ #{sudo_env('yum')} -y install ruby ruby-devel > #{detect_debug}
173
184
  fi
174
185
  fi
175
186
  else
176
- #{update_packages_redhat_cmd}
177
- #{sudo_env('yum')} -y install ruby ruby-devel gcc
187
+ #{update_packages_redhat_cmd} > #{detect_debug}
188
+ #{sudo_env('yum')} -y install ruby ruby-devel gcc > #{detect_debug}
178
189
  fi
179
190
  elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
180
- #{update_packages_suse_cmd}
181
- #{sudo_env('zypper')} --non-interactive install ruby ruby-devel ca-certificates ca-certificates-cacert ca-certificates-mozilla
191
+ #{update_packages_suse_cmd} > #{detect_debug}
192
+ #{sudo_env('zypper')} --non-interactive install ruby ruby-devel ca-certificates ca-certificates-cacert ca-certificates-mozilla > #{detect_debug}
182
193
  #{sudo_env('gem')} sources --add https://rubygems.org/
183
194
  elif [ -f /etc/alpine-release ] || [ -d /etc/apk ]; then
184
195
  #{update_packages_alpine_cmd}
185
- #{sudo_env('apk')} add ruby ruby-dev ruby-io-console ca-certificates
196
+ #{sudo_env('apk')} add ruby ruby-dev ruby-io-console ca-certificates > #{detect_debug}
186
197
  else
187
198
  if [ ! $(which ruby) ]; then
188
199
  #{update_packages_debian_cmd}
@@ -203,14 +214,14 @@ module Kitchen
203
214
  PACKAGES="ruby ruby-dev"
204
215
  fi
205
216
  fi
206
- #{sudo_env('apt-get')} -y install $PACKAGES
217
+ #{sudo_env('apt-get')} -y install $PACKAGES > #{detect_debug}
207
218
  if [ $debvers -eq 6 ]; then
208
219
  # in squeeze we need to update alternatives
209
220
  # for enable ruby1.9.1
210
221
  ALTERNATIVES_STRING="--install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 10 --slave /usr/share/man/man1/ruby.1.gz ruby.1.gz /usr/share/man/man1/ruby1.9.1.1.gz --slave /usr/bin/erb erb /usr/bin/erb1.9.1 --slave /usr/bin/gem gem /usr/bin/gem1.9.1 --slave /usr/bin/irb irb /usr/bin/irb1.9.1 --slave /usr/bin/rake rake /usr/bin/rake1.9.1 --slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1 --slave /usr/bin/testrb testrb /usr/bin/testrb1.9.1 --slave /usr/share/man/man1/erb.1.gz erb.1.gz /usr/share/man/man1/erb1.9.1.1.gz --slave /usr/share/man/man1/gem.1.gz gem.1.gz /usr/share/man/man1/gem1.9.1.1.gz --slave /usr/share/man/man1/irb.1.gz irb.1.gz /usr/share/man/man1/irb1.9.1.1.gz --slave /usr/share/man/man1/rake.1.gz rake.1.gz /usr/share/man/man1/rake1.9.1.1.gz --slave /usr/share/man/man1/rdoc.1.gz rdoc.1.gz /usr/share/man/man1/rdoc1.9.1.1.gz --slave /usr/share/man/man1/testrb.1.gz testrb.1.gz /usr/share/man/man1/testrb1.9.1.1.gz"
211
222
  #{sudo_env('update-alternatives')} $ALTERNATIVES_STRING
212
223
  # need to update gem tool because gem 1.3.7 from ruby 1.9.1 is broken
213
- #{sudo_env('gem')} install rubygems-update
224
+ #{sudo_env('gem')} install rubygems-update > #{detect_debug}
214
225
  #{sudo_env('/var/lib/gems/1.9.1/bin/update_rubygems')}
215
226
  # clear local gem cache
216
227
  #{sudo_env('rm')} -r /home/vagrant/.gem
@@ -227,7 +238,7 @@ module Kitchen
227
238
  echo "-----> Installing Chef Omnibus to install busser to run tests"
228
239
  #{export_http_proxy}
229
240
  do_download #{chef_url} /tmp/install.sh
230
- #{sudo_env('sh')} /tmp/install.sh
241
+ #{sudo_env('sh')} /tmp/install.sh > #{detect_debug}
231
242
  fi
232
243
  INSTALL
233
244
  end
@@ -466,59 +477,61 @@ module Kitchen
466
477
  end
467
478
 
468
479
  def install_ansible_from_source_command
469
- <<-INSTALL
470
- if [ ! -d #{config[:root_path]}/ansible ]; then
471
- if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
472
- #{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
473
- #{update_packages_redhat_cmd}
474
- #{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools python-setuptools-dev libffi-devel libssl-devel
475
- else
476
- if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
477
- #{sudo_env('zypper')} ar #{python_sles_repo}
478
- #{update_packages_suse_cmd}
479
- #{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel
480
+ <<-INSTALL
481
+ if [ ! -d #{config[:root_path]}/ansible ]; then
482
+ if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
483
+ #{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
484
+ #{update_packages_redhat_cmd} > #{detect_debug}
485
+ #{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools python-setuptools-dev libffi-devel libssl-devel > #{detect_debug}
480
486
  else
481
- #{update_packages_debian_cmd}
482
- #{sudo_env('apt-get')} -y install git python python-setuptools build-essential python-dev libffi-dev libssl-dev
487
+ if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
488
+ #{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
489
+ #{update_packages_suse_cmd} > #{detect_debug}
490
+ #{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel > #{detect_debug}
491
+ else
492
+ #{update_packages_debian_cmd} > #{detect_debug}
493
+ #{sudo_env('apt-get')} -y install git python python-setuptools build-essential python-dev libffi-dev libssl-dev > #{detect_debug}
494
+ fi
483
495
  fi
484
- fi
485
496
 
486
- #{export_http_proxy}
487
- git clone #{config[:ansible_source_url]} --recursive #{config[:root_path]}/ansible #{install_source_rev}
488
- #{sudo_env('easy_install')} pip
489
- #{sudo_env('pip')} install -U setuptools
490
- #{sudo_env('pip')} install six paramiko PyYAML Jinja2 httplib2
491
- fi
492
- INSTALL
497
+ #{export_http_proxy}
498
+ git clone #{config[:ansible_source_url]} --recursive #{config[:root_path]}/ansible #{install_source_rev}
499
+ #{sudo_env('easy_install')} pip > #{detect_debug}
500
+ #{sudo_env('pip')} install -U setuptools > #{detect_debug}
501
+ #{sudo_env('pip')} install six paramiko PyYAML Jinja2 httplib2 > #{detect_debug}
502
+ fi
503
+ INSTALL
493
504
  end
494
505
 
495
506
  def install_ansible_from_pip_command
496
- ansible_version = ''
497
- ansible_version = "==#{config[:ansible_version]}" unless config[:ansible_version] == 'latest'
507
+ if config[:ansible_version]=='latest' or config[:ansible_version].nil?
508
+ ansible_version = ''
509
+ else
510
+ ansible_version = "==#{config[:ansible_version]}"
511
+ end
512
+ <<-INSTALL
513
+ if [ ! $(which ansible) ]; then
514
+ if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
515
+ #{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
516
+ #{update_packages_redhat_cmd} > #{detect_debug}
517
+ #{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools python-setuptools-dev libffi-devel openssl-devel gcc > #{detect_debug}
518
+ else
519
+ if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
520
+ #{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
521
+ #{update_packages_suse_cmd} > #{detect_debug}
522
+ #{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel > #{detect_debug}
523
+ else
524
+ #{update_packages_debian_cmd} > #{detect_debug}
525
+ #{sudo_env('apt-get')} -y install git python python-setuptools build-essential python-dev libffi-dev libssl-dev > #{detect_debug}
526
+ fi
527
+ fi
498
528
 
499
- <<-INSTALL
500
- if [ ! -d #{config[:root_path]}/ansible ]; then
501
- if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
502
- #{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
503
- #{update_packages_redhat_cmd}
504
- #{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools python-setuptools-dev libffi-devel openssl-devel gcc
505
- else
506
- if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
507
- #{sudo_env('zypper')} ar #{python_sles_repo}
508
- #{update_packages_suse_cmd}
509
- #{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel
510
- else
511
- #{update_packages_debian_cmd}
512
- #{sudo_env('apt-get')} -y install git python python-setuptools build-essential python-dev libffi-dev libssl-dev
513
- fi
529
+ #{export_http_proxy}
530
+ #{sudo_env('easy_install')} pip > #{detect_debug}
531
+ #{sudo_env('pip')} install -U setuptools > #{detect_debug}
532
+ #{sudo_env('pip')} install ansible#{ansible_version} > #{detect_debug}
514
533
  fi
515
-
516
- #{export_http_proxy}
517
- #{sudo_env('easy_install')} pip
518
- #{sudo_env('pip')} install -U setuptools
519
- #{sudo_env('pip')} install ansible#{ansible_version}
520
- fi
521
- INSTALL
534
+ INSTALL
522
535
  end
523
536
 
524
537
  def install_omnibus_command
@@ -534,7 +547,7 @@ module Kitchen
534
547
  echo "-----> Installing Ansible Omnibus"
535
548
  #{export_http_proxy}
536
549
  do_download #{config[:ansible_omnibus_url]} /tmp/ansible_install.sh
537
- #{sudo_env(config[:shell_command])} /tmp/ansible_install.sh #{version}
550
+ #{sudo_env(config[:shell_command])} /tmp/ansible_install.sh #{version} > #{detect_debug}
538
551
  fi
539
552
  INSTALL
540
553
  end
@@ -867,8 +880,12 @@ module Kitchen
867
880
  roles_paths = []
868
881
  roles_paths << File.join(config[:root_path], 'roles') unless config[:roles_path].nil?
869
882
  if config[:additional_copy_role_path]
870
- config[:additional_copy_path].each do |path|
871
- roles_paths << File.join(config[:root_path], File.basename(path))
883
+ if config[:additional_copy_role_path].is_a? String
884
+ roles_paths << File.expand_path(config[:additional_copy_role_path])
885
+ else
886
+ config[:additional_copy_path].each do |path|
887
+ roles_paths << File.join(config[:root_path], File.expand_path(File.basename(path)))
888
+ end
872
889
  end
873
890
  end
874
891
  if roles_paths.empty?
@@ -889,7 +906,7 @@ module Kitchen
889
906
  if galaxy_requirements
890
907
  dest = File.join(sandbox_path, galaxy_requirements)
891
908
  FileUtils.mkdir_p(File.dirname(dest))
892
- FileUtils.cp(galaxy_requirements, dest)
909
+ FileUtils.cp(File.expand_path(galaxy_requirements), dest)
893
910
  end
894
911
 
895
912
  FileUtils.mkdir_p(File.join(tmp_roles_dir, role_name))
@@ -981,10 +998,10 @@ module Kitchen
981
998
  info('Preparing additional_copy_path')
982
999
  additional_files.each do |file|
983
1000
  info("Copy additional path: #{file}")
984
- destination = File.join(sandbox_path, File.basename(file))
985
- if File.directory?(file)
986
- debug("Copy dir: #{file} #{destination}")
987
- FileUtils.cp_r(file, destination)
1001
+ destination = File.join(sandbox_path, File.basename(File.expand_path(file)))
1002
+ if File.directory?(File.expand_path(file)) && File.basename(File.expand_path(file))!= ?.
1003
+ debug("Copy dir: #{File.expand_path(file)} #{destination}")
1004
+ FileUtils.cp_r(File.expand_path(file), destination)
988
1005
  else
989
1006
  debug("Copy file: #{file} #{destination}")
990
1007
  FileUtils.cp(file, destination)
@@ -995,7 +1012,9 @@ module Kitchen
995
1012
  Find.find(file) do |files|
996
1013
  destination = File.join(sandbox_path, files)
997
1014
  Find.prune if config[:ignore_paths_from_root].include? File.basename(files)
1015
+ Find.prune if "?.".include? File.basename(files)
998
1016
  Find.prune if config[:ignore_extensions_from_root].include? File.extname(files)
1017
+ debug File.basename(files)
999
1018
  if File.directory?(files)
1000
1019
  FileUtils.mkdir_p(destination)
1001
1020
  else
@@ -1114,7 +1133,7 @@ module Kitchen
1114
1133
  if config[:additional_ssh_private_keys]
1115
1134
  config[:additional_ssh_private_keys].each do |key|
1116
1135
  debug("Adding additional_ssh_private_key file #{key}")
1117
- FileUtils.cp_r(key, tmp_additional_ssh_private_keys_dir, remove_destination: true)
1136
+ FileUtils.cp_r(File.expand_path(key), tmp_additional_ssh_private_keys_dir, remove_destination: true)
1118
1137
  end
1119
1138
  else
1120
1139
  info 'nothing to do for additional_ssh_private_keys'
@@ -1127,7 +1146,7 @@ module Kitchen
1127
1146
  info('Preparing ansible vault password')
1128
1147
  debug("Copying ansible vault password file from #{ansible_vault_password_file} to #{tmp_ansible_vault_password_file_path}")
1129
1148
 
1130
- FileUtils.cp(ansible_vault_password_file, tmp_ansible_vault_password_file_path)
1149
+ FileUtils.cp(File.expand_path(ansible_vault_password_file), tmp_ansible_vault_password_file_path)
1131
1150
  end
1132
1151
 
1133
1152
  def prepare_kerberos_conf_file
@@ -1136,7 +1155,7 @@ module Kitchen
1136
1155
  info('Preparing kerberos configuration file')
1137
1156
  debug("Copying kerberos configuration file from #{kerberos_conf_file} to #{tmp_kerberos_conf_file_path}")
1138
1157
 
1139
- FileUtils.cp(kerberos_conf_file, tmp_kerberos_conf_file_path)
1158
+ FileUtils.cp(File.expand_path(kerberos_conf_file), tmp_kerberos_conf_file_path)
1140
1159
  end
1141
1160
 
1142
1161
  def resolve_with_librarian
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module Kitchen
3
3
  module Ansible
4
- VERSION = '0.46.4'.freeze
4
+ VERSION = '0.47.0'.freeze
5
5
  end
6
6
  end
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.46.4
4
+ version: 0.47.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: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen