Skip to content

Commit

Permalink
test various install options and update and document
Browse files Browse the repository at this point in the history
  • Loading branch information
neillturner committed Apr 9, 2021
1 parent 57ade70 commit b1ea8b7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/kitchen-ansible/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
module Kitchen
module Ansible
VERSION = '0.55.0'.freeze
VERSION = '0.56.0'.freeze
end
end
4 changes: 2 additions & 2 deletions lib/kitchen/provisioner/ansible/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class Config
default_config :tags, []
default_config :ansible_apt_repo, 'ppa:ansible/ansible'
default_config :ansible_yum_repo, nil
default_config :ansible_sles_repo, 'http://download.opensuse.org/repositories/systemsmanagement/SLE_12/systemsmanagement.repo'
default_config :python_sles_repo, 'http://download.opensuse.org/repositories/devel:/languages:/python/SLE_12/devel:languages:python.repo'
default_config :ansible_sles_repo, 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_15.2/systemsmanagement.repo'
default_config :python_sles_repo, 'http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_15.2/devel:languages:python.repo'
default_config :chef_bootstrap_url, 'https://www.chef.io/chef/install.sh'
# Providing we have Ruby >= 2.0 we only need Ruby. Leaving default to install Chef Omnibus for backwards compatibility.
# Note: if using kitchen-verifer-serverspec your we can avoid needing Ruby too.
Expand Down
14 changes: 10 additions & 4 deletions lib/kitchen/provisioner/ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,13 @@ def install_ansible_from_pip_command
<<-INSTALL
if [ ! $(which ansible) ]; then
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
EL_RELEASE=$(rpm -E %{rhel})
if [ "${EL_RELEASE}" -ge 8 ]; then
echo "*** Redhat/Centos 8 does not support pip2 with kitchen-ansible ***"
fi
#{Kitchen::Provisioner::Ansible::Os::Redhat.new('redhat', config).install_epel_repo}
#{update_packages_redhat_cmd} > #{detect_debug}
#{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools python-setuptools-dev libffi-devel openssl-devel gcc > #{detect_debug}
#{sudo_env('yum')} -y install libselinux-python python2-devel git python-setuptools libffi-devel openssl-devel gcc > #{detect_debug}
else
if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
#{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
Expand All @@ -558,7 +562,8 @@ def install_ansible_from_pip_command
fi
#{export_http_proxy}
#{sudo_env('easy_install')} pip > #{detect_debug}
#{sudo_env('curl')} 'https://bootstrap.pypa.io/pip/2.7/get-pip.py' -o 'get-pip.py' > #{detect_debug}
#{sudo_env('python')} 'get-pip.py' > #{detect_debug}
#{sudo_env('pip')} install -U setuptools > #{detect_debug}
#{sudo_env('pip')} install ansible#{ansible_version} > #{detect_debug}
fi
Expand All @@ -581,14 +586,15 @@ def install_ansible_from_pip3_command
if [ -f /etc/SUSE-brand ] || [ -f /etc/SuSE-release ]; then
#{sudo_env('zypper')} ar #{python_sles_repo} > #{detect_debug}
#{update_packages_suse_cmd} > #{detect_debug}
#{sudo_env('zypper')} --non-interactive install python python-devel git python-setuptools python-pip python-six libyaml-devel libffi-devel libopenssl-devel > #{detect_debug}
#{sudo_env('zypper')} --non-interactive install python3 python3-pip python3-setuptools python-devel git python-six libyaml-devel libffi-devel libopenssl-devel > #{detect_debug}
else
#{update_packages_debian_cmd} > #{detect_debug}
#{sudo_env('apt-get')} -y install git python python-pip python-setuptools build-essential python-dev libffi-dev libssl-dev > #{detect_debug}
#{sudo_env('apt-get')} -y install git python3 python3-pip python3-setuptools build-essential python3-dev libffi-dev libssl-dev > #{detect_debug}
fi
fi
#{export_http_proxy}
#{sudo_env('python3')} -m pip install --upgrade pip > #{detect_debug}
#{sudo_env('pip3')} install -U setuptools > #{detect_debug}
#{sudo_env('pip3')} install ansible#{ansible_version} > #{detect_debug}
fi
Expand Down
19 changes: 17 additions & 2 deletions provisioner_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ It installs it in the following order:

NOTE: Set to ansible_package_name to 'ansible' when installing from the CentOS/Redhat extras repo, instead of the EPEL.

# Install Options Maxtrix

Install options require_XXXX parameter by operation system

OS | repo | pip | pip3 | ansible_source | ansible_omnibus
---|------|-----|------|----------------|----------------
centos-72 | YES | YES | YES | NO | YES
centos-8 | YES | NO | YES | NO | NO
ubuntu-1604 | YES | YES | NO | NO | YES
ubuntu-2004 | YES | NO | YES | NO | YES
debian-9 | YES | YES | YES | NO | YES
debian-10 | YES | YES | YES | NO | YES
suse-15 | YES | YES | YES | NO | NO
alpine-38 | UNTESTED | NO | NO | NO | NO

# Provisioner Options

kitchen-ansible runs the ansible playbook command http://linux.die.net/man/1/ansible-playbook with options from parameters in the kitchen.yml file:
Expand All @@ -53,7 +68,7 @@ ansible_omnibus_url | `https://raw.githubusercontent.com` `/neillturner/omnibus-
ansible_package_name | | Set to ansible when installing from the CentOS/Redhat extras repo, instead of the EPEL.
ansible_platform | Naively tries to determine | OS platform of server
ansible_playbook_command | | Override the Ansible playbook command
ansible_sles_repo | `http://download.opensuse.org/repositories` `/systemsmanagement/SLE_12` `/systemsmanagement.repo` | Zypper SuSE Ansible repo
ansible_sles_repo | `http://download.opensuse.org/repositories` `/systemsmanagement/openSUSE_Leap_15.2` `/systemsmanagement.repo` | Zypper SuSE Ansible repo
ansible_source_url | `git://github.com/ansible/ansible.git` | Git URL of Ansible source
ansible_source_rev | | Branch or tag to install Ansible source
ansible_sudo | true | Determines whether `ansible-playbook` is executed as root or as the current authenticated user
Expand Down Expand Up @@ -94,7 +109,7 @@ modules_path | | Ansible repo manifests directory
no_proxy | nil | List of URLs or IPs that should be excluded from proxying
playbook | default.yml | Playbook for `ansible-playbook` to run
private_key | | ssh private key file for ssh connection
python_sles_repo | `http://download.opensuse.org/repositories` `/devel:/languages:/python/SLE_12` `/devel:languages:python.repo` | Zypper SuSE python repo
python_sles_repo | `http://download.opensuse.org/repositories` `/devel:/languages:/python/openSUSE_Leap_15.2` `/devel:languages:python.repo` | Zypper SuSE python repo
recursive_additional_copy_path | | Arbitrary array of files and directories to copy into test environment. See below section Copying Additional Files
require_ansible_omnibus | false | Set to `true` if using Omnibus Ansible `pip` install
require_ansible_repo | true | Set if installing Ansible from a `yum` or `apt` repo
Expand Down

0 comments on commit b1ea8b7

Please sign in to comment.