kitchen-ansible 0.51.0 → 0.52.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: 74eb7dd611a7bf5dba02f9efd7958f56476036ba7d47f4801da4bf205f662ac0
4
- data.tar.gz: 4f21d7462726ebf52fce8816c047e95450e8fcbf17bcbfc1c2821c2c09490c9b
3
+ metadata.gz: fcf3c0b3410c365569e9b26c6e5266f1b3217a7af788440c9bc67770578d029f
4
+ data.tar.gz: e34eb4cbb1f2f5281f3ca066e73d7a72e50bc315856b9bb5837d74b0cc6fe9b8
5
5
  SHA512:
6
- metadata.gz: 438fa9cc8422b1da362bcfb8f61b4f2acb62ffb75400c116efbd10fa01eec3b2a2239a14a4f6fc19dfeed1b37e8530c221c2985557fbb4c7bd372e2ef76373c5
7
- data.tar.gz: 3e34d003eca48a0577a430ddd2fd5afc084da58b239e360932b5431bd0eda327f7a19a0babaf95f6281957fede9a19079ed767216184d3cc5c6d3d29b99d92f5
6
+ metadata.gz: 5859df7d528ca944d8f2547aef1ca0a0d6aa9cbc8efa0cb0a6e545fa531d84dbe9b87819b72fff5d0554b437a2564ff1d173578b2d0602639baf8d445424ca89
7
+ data.tar.gz: 8280cd6d6edf1fd87f67233c72548920971a6ed74939785e29e26a9b9488a438011c065e69a0669db226dd14834be1f0cbba0ed1c2ab7488b3883cc6ba27ef7e
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module Kitchen
3
3
  module Ansible
4
- VERSION = '0.51.0'.freeze
4
+ VERSION = '0.52.0'.freeze
5
5
  end
6
6
  end
@@ -54,6 +54,7 @@ module Kitchen
54
54
  default_config :require_ruby_for_busser, false
55
55
  default_config :require_windows_support, false
56
56
  default_config :require_pip, false
57
+ default_config :require_pip3, false
57
58
  default_config :requirements_path, false
58
59
  default_config :requirements_collection_path, false
59
60
  default_config :ssh_known_hosts, nil
@@ -104,6 +105,12 @@ module Kitchen
104
105
  fail('No roles_path detected. Please specify one in .kitchen.yml')
105
106
  end
106
107
 
108
+ default_config :ansible_binary_path do |provisioner|
109
+ if provisioner[:require_pip3]
110
+ fail('No ansible_binary_path detected. Please specify one in .kitchen.yml')
111
+ end
112
+ end
113
+
107
114
  default_config :group_vars_path do |provisioner|
108
115
  provisioner.calculate_path('group_vars', :directory)
109
116
  end
@@ -76,6 +76,9 @@ module Kitchen
76
76
  elsif config[:require_pip]
77
77
  info('Installing ansible through pip')
78
78
  cmd = install_ansible_from_pip_command
79
+ elsif config[:require_pip3]
80
+ info('Installing ansible through pip3')
81
+ cmd = install_ansible_from_pip3_command
79
82
  elsif config[:require_ansible_repo]
80
83
  if !@os.nil?
81
84
  info("Installing ansible on #{@os.name}")
@@ -562,6 +565,36 @@ module Kitchen
562
565
  INSTALL
563
566
  end
564
567
 
568
+ def install_ansible_from_pip3_command
569
+ if config[:ansible_version]=='latest' or config[:ansible_version].nil?
570
+ ansible_version = ''
571
+ else
572
+ ansible_version = "==#{config[:ansible_version]}"
573
+ end
574
+ <<-INSTALL
575
+ if [ ! $(which ansible) ]; then
576
+ if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
577
+ #{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
578
+ #{update_packages_redhat_cmd} > #{detect_debug}
579
+ #{sudo_env('yum')} -y install python3-libselinux python3-devel python3-pip git libffi-devel openssl-devel gcc > #{detect_debug}
580
+ else
581
+ if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
582
+ #{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
583
+ #{update_packages_suse_cmd} > #{detect_debug}
584
+ #{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel > #{detect_debug}
585
+ else
586
+ #{update_packages_debian_cmd} > #{detect_debug}
587
+ #{sudo_env('apt-get')} -y install git python python-pip python-setuptools build-essential python-dev libffi-dev libssl-dev > #{detect_debug}
588
+ fi
589
+ fi
590
+
591
+ #{export_http_proxy}
592
+ #{sudo_env('pip3')} install -U setuptools > #{detect_debug}
593
+ #{sudo_env('pip3')} install ansible#{ansible_version} > #{detect_debug}
594
+ fi
595
+ INSTALL
596
+ end
597
+
565
598
  def install_omnibus_command
566
599
  info('Installing ansible using ansible omnibus')
567
600
 
@@ -16,6 +16,12 @@ It installs it in the following order:
16
16
 
17
17
  Install require packages and then installs ansible using the python pip command and ansible version must be specified. This allows a specific version of ansible to be installed.
18
18
 
19
+ * if require_pip3 is set to true
20
+
21
+ Install require packages and then installs ansible using the python pip3 command and ansible version must be specified. This allows a specific version of ansible to be installed.
22
+
23
+ Currently only works for Redhat/Centos.
24
+
19
25
  * if require_ansible_repo is set to true (the default)
20
26
 
21
27
  Installs from the operation system repository only with the ansible version that is in the particular repository and will use the ansible_version in the package name where appropriate.
@@ -95,6 +101,7 @@ require_ansible_repo | true | Set if installing Ansible from a `yum` or `apt` re
95
101
  require_ansible_source | false | Install Ansible from source using method described [here](http://docs.ansible.com/intro_installation.html#running-from-source). Only works on Debian/Ubuntu at present
96
102
  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.
97
103
  require_pip | false | Set to `true` if Ansible is to be installed through `pip`).
104
+ require_pip3 | false | Set to `true` if Ansible is to be installed through `pip3`).
98
105
  require_ruby_for_busser | false | Install Ruby to run Busser for tests
99
106
  require_windows_support | false | Install [Windows support](http://docs.ansible.com/ansible/intro_windows.html)
100
107
  requirements_path | | Path to Ansible Galaxy requirements
@@ -110,6 +117,19 @@ update_package_repos | true | Update OS repository metadata
110
117
  wait_for_retry | 30 | number of seconds to wait before retrying converge command
111
118
  ignore_ansible_cfg | false | If true, values from ansible.cfg file will not be loaded.
112
119
 
120
+ ## require_pip3
121
+
122
+ if using python 3 and wish to install via pip specify
123
+ ```yaml
124
+ ansible_binary_path: /usr/local/bin
125
+ require_pip3: true
126
+ ```
127
+
128
+
129
+ you must specify ansible_binary_path as well.
130
+
131
+ Currently this only works for Centos and Redhat
132
+
113
133
  ## Ansible Inventory
114
134
 
115
135
  Ansible has the concept of an [inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html).
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.51.0
4
+ version: 0.52.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: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec