kitchen-ansible 0.45.4 → 0.45.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +232 -232
- data/kitchen-ansible.gemspec +39 -39
- data/lib/kitchen-ansible/version.rb +6 -6
- data/lib/kitchen/provisioner/ansible/config.rb +184 -178
- data/lib/kitchen/provisioner/ansible/librarian.rb +78 -78
- data/lib/kitchen/provisioner/ansible/os.rb +78 -72
- data/lib/kitchen/provisioner/ansible/os/alpine.rb +42 -0
- data/lib/kitchen/provisioner/ansible/os/amazon.rb +42 -42
- data/lib/kitchen/provisioner/ansible/os/darwin.rb +37 -0
- data/lib/kitchen/provisioner/ansible/os/debian.rb +69 -69
- data/lib/kitchen/provisioner/ansible/os/fedora.rb +60 -60
- data/lib/kitchen/provisioner/ansible/os/redhat.rb +70 -70
- data/lib/kitchen/provisioner/ansible/os/suse.rb +44 -44
- data/lib/kitchen/provisioner/ansible_playbook.rb +1090 -1073
- data/provisioner_options.md +129 -126
- metadata +18 -16
data/provisioner_options.md
CHANGED
@@ -1,126 +1,129 @@
|
|
1
|
-
# Ansible Install Options
|
2
|
-
|
3
|
-
Kitchen-ansible is very flexible in how it installs ansible:
|
4
|
-
|
5
|
-
It installs it in the following order:
|
6
|
-
|
7
|
-
* if require_ansible_omnibus is set to true
|
8
|
-
|
9
|
-
Installs using the omnibus_ansible script specified in the ansible_omnibus_url parameter and passes the ansible_version if specied as -v option.
|
10
|
-
|
11
|
-
* If require_ansible_source is set to true
|
12
|
-
|
13
|
-
Install require packages and download the ansible source from github from master or from a branch specified in the parameter install_source_rev.
|
14
|
-
|
15
|
-
* if require_pip is set to true
|
16
|
-
|
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
|
-
|
19
|
-
* if require_ansible_repo is set to true (the default)
|
20
|
-
|
21
|
-
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.
|
22
|
-
|
23
|
-
# Provisioner Options
|
24
|
-
|
25
|
-
kitchen-ansible runs the ansible playbook command http://linux.die.net/man/1/ansible-playbook with options from parameters in the kitchen.yml file:
|
26
|
-
|
27
|
-
key | default value | Notes
|
28
|
-
----|---------------|--------
|
29
|
-
additional_copy_path | | Arbitrary array of files and directories to copy into test environment, relative to the current dir, e.g. vars or included playbooks
|
30
|
-
additional_copy_role_path | false | additional_copy_path directories are appended to the ANSIBLE_ROLES_PATH env var when running ansible
|
31
|
-
ansible_apt_repo | ppa:ansible/ansible | `apt` repo; see `https://launchpad.net` `/~ansible/+archive/ubuntu/ansible` or `rquillo/ansible`
|
32
|
-
ansible_binary_path | NULL | If specified this will override the location where `kitchen` tries to run `ansible-playbook` from, i.e. `ansible_binary_path: /usr/local/bin`
|
33
|
-
ansible_check | false | Sets the `--check` flag when running Ansible
|
34
|
-
ansible_connection | local | use `ssh` if the host is not `localhost` (Linux) or `winrm` (Windows) or `none` if defined in inventory
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
name:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
1
|
+
# Ansible Install Options
|
2
|
+
|
3
|
+
Kitchen-ansible is very flexible in how it installs ansible:
|
4
|
+
|
5
|
+
It installs it in the following order:
|
6
|
+
|
7
|
+
* if require_ansible_omnibus is set to true
|
8
|
+
|
9
|
+
Installs using the omnibus_ansible script specified in the ansible_omnibus_url parameter and passes the ansible_version if specied as -v option.
|
10
|
+
|
11
|
+
* If require_ansible_source is set to true
|
12
|
+
|
13
|
+
Install require packages and download the ansible source from github from master or from a branch specified in the parameter install_source_rev.
|
14
|
+
|
15
|
+
* if require_pip is set to true
|
16
|
+
|
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
|
+
|
19
|
+
* if require_ansible_repo is set to true (the default)
|
20
|
+
|
21
|
+
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.
|
22
|
+
|
23
|
+
# Provisioner Options
|
24
|
+
|
25
|
+
kitchen-ansible runs the ansible playbook command http://linux.die.net/man/1/ansible-playbook with options from parameters in the kitchen.yml file:
|
26
|
+
|
27
|
+
key | default value | Notes
|
28
|
+
----|---------------|--------
|
29
|
+
additional_copy_path | | Arbitrary array of files and directories to copy into test environment, relative to the current dir, e.g. vars or included playbooks
|
30
|
+
additional_copy_role_path | false | additional_copy_path directories are appended to the ANSIBLE_ROLES_PATH env var when running ansible
|
31
|
+
ansible_apt_repo | ppa:ansible/ansible | `apt` repo; see `https://launchpad.net` `/~ansible/+archive/ubuntu/ansible` or `rquillo/ansible`
|
32
|
+
ansible_binary_path | NULL | If specified this will override the location where `kitchen` tries to run `ansible-playbook` from, i.e. `ansible_binary_path: /usr/local/bin`
|
33
|
+
ansible_check | false | Sets the `--check` flag when running Ansible
|
34
|
+
ansible_connection | local | use `ssh` if the host is not `localhost` (Linux) or `winrm` (Windows) or `none` if defined in inventory
|
35
|
+
ansible_cfg_path | ansible.cfg | location of custom ansible.cfg to get copied into test environment
|
36
|
+
ansible_diff | false | Sets the `--diff` flag when running Ansible
|
37
|
+
ansible_extra_flags | | Additional options to pass to ansible-playbook, e.g. `'--skip-tags=redis'`
|
38
|
+
ansible_host_key_checking | true | Strict host key checking in ssh
|
39
|
+
ansible_inventory | | Static or dynamic inventory file or directory or 'none' if defined in `ansible.cfg`
|
40
|
+
ansible_limit | | Further limits the selected host/group patterns
|
41
|
+
ansible_omnibus_remote_path | /opt/ansible | Server installation location of an Omnibus Ansible install
|
42
|
+
ansible_omnibus_url | `https://raw.githubusercontent.com` `/neillturner/omnibus-ansible` `/master/ansible_install.sh` | Omnibus Ansible install location
|
43
|
+
ansible_platform | Naively tries to determine | OS platform of server
|
44
|
+
ansible_playbook_command | | Override the Ansible playbook command
|
45
|
+
ansible_sles_repo | `http://download.opensuse.org/repositories` `/systemsmanagement/SLE_12` `/systemsmanagement.repo` | Zypper SuSE Ansible repo
|
46
|
+
ansible_source_rev | | Branch or tag to install Ansible source
|
47
|
+
ansible_sudo | true | Determines whether `ansible-playbook` is executed as root or as the current authenticated user
|
48
|
+
ansible_vault_password_file | | Path to Ansible Vault password file
|
49
|
+
ansible_verbose | false | Extra information logging
|
50
|
+
ansible_verbosity | 1 | Sets the verbosity flag appropriately, e.g.: `1 => '-v', 2 => '-vv', 3 => '-vvv' ...`. Valid values are: `1, 2, 3, 4` or `:info, :warn, :debug, :trace`
|
51
|
+
ansible_version | latest | Desired version, only affects `apt-get` installs
|
52
|
+
ansible_yum_repo | nil | `yum` repo for EL platforms
|
53
|
+
ansiblefile_path | | Path to Ansiblefile
|
54
|
+
callback_plugins_path | callback_plugins | Ansible repo `callback_plugins` directory
|
55
|
+
chef_bootstrap_url | `https://www.getchef.com/chef/install.sh` | The Chef install
|
56
|
+
enable_yum_epel | false | Enable the `yum` EPEL repo
|
57
|
+
env_vars | Hash.new | Hash to set environment variable to use with `ansible-playbook` command
|
58
|
+
extra_vars | Hash.new | Hash to set the `extra_vars` passed to `ansible-playbook` command
|
59
|
+
filter_plugins_path | filter_plugins | Ansible repo `filter_plugins` directory
|
60
|
+
group_vars_path | group_vars | Ansible repo group_vars directory
|
61
|
+
host_vars_path | host_vars | Ansible repo hosts directory
|
62
|
+
hosts | | Create Ansible hosts file for localhost with this server group
|
63
|
+
http_proxy | nil | Use HTTP proxy when installing Ansible, packages and running Ansible
|
64
|
+
https_proxy | nil | Use HTTPS proxy when installing Ansible, packages and running Ansible
|
65
|
+
idempotency_test | false | Enable to test Ansible playbook idempotency
|
66
|
+
ignore_extensions_from_root | ['.pyc'] | allow extensions to be ignored when copying from roles and recursive_additional_copy_path
|
67
|
+
ignore_paths_from_root | [] | allow extra paths to be ignored when copying from roles and recursive_additional_copy_path
|
68
|
+
kerberos_conf_file | | Path of krb5.conf file using in Windows support
|
69
|
+
library_plugins_path | library | Ansible repo library plugins directory
|
70
|
+
lookup_plugins_path | lookup_plugins | Ansible repo `lookup_plugins` directory
|
71
|
+
modules_path | | Ansible repo manifests directory
|
72
|
+
no_proxy | nil | List of URLs or IPs that should be excluded from proxying
|
73
|
+
playbook | default.yml | Playbook for `ansible-playbook` to run
|
74
|
+
private_key | | ssh private key file for ssh connection
|
75
|
+
python_sles_repo | `http://download.opensuse.org/repositories` `/devel:/languages:/python/SLE_12` `/devel:languages:python.repo` | Zypper SuSE python repo
|
76
|
+
recursive_additional_copy_path | | Arbitrary array of files and directories to copy into test environment, relative to the current dir, e.g. vars or included playbooks
|
77
|
+
require_ansible_omnibus | false | Set to `true` if using Omnibus Ansible `pip` install
|
78
|
+
require_ansible_repo | true | Set if installing Ansible from a `yum` or `apt` repo
|
79
|
+
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
|
80
|
+
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.
|
81
|
+
require_pip | false | Set to `true` if Ansible is to be installed through `pip`).
|
82
|
+
require_ruby_for_busser | false | Install Ruby to run Busser for tests
|
83
|
+
require_windows_support | false | Install [Windows support](http://docs.ansible.com/ansible/intro_windows.html)
|
84
|
+
requirements_path | | Path to Ansible Galaxy requirements
|
85
|
+
role_name | | use when the repo name does not match the name the role is published as.
|
86
|
+
roles_path | roles | Ansible repo roles directory
|
87
|
+
shell_command | 'sh' | Shell command to use, usually an alias for bash. may need to set to bash.
|
88
|
+
ssh_known_hosts | | List of hosts that should be added to ~/.ssh/known_hosts
|
89
|
+
sudo_command | sudo -E | `sudo` command; change to `sudo -E -H` to be consistent with Ansible
|
90
|
+
update_package_repos | true | Update OS repository metadata
|
91
|
+
|
92
|
+
## Configuring Provisioner Options
|
93
|
+
|
94
|
+
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
95
|
+
|
96
|
+
```yaml
|
97
|
+
---
|
98
|
+
driver:
|
99
|
+
name: vagrant
|
100
|
+
|
101
|
+
provisioner:
|
102
|
+
name: ansible_playbook
|
103
|
+
roles_path: roles
|
104
|
+
hosts: tomcat-servers
|
105
|
+
require_ansible_repo: true
|
106
|
+
ansible_verbose: true
|
107
|
+
ansible_verbosity: 2
|
108
|
+
ansible_diff: true
|
109
|
+
|
110
|
+
platforms:
|
111
|
+
- name: nocm_ubuntu-12.04
|
112
|
+
driver_plugin: vagrant
|
113
|
+
driver_config:
|
114
|
+
box: nocm_ubuntu-12.04
|
115
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
116
|
+
|
117
|
+
suites:
|
118
|
+
- name: default
|
119
|
+
```
|
120
|
+
|
121
|
+
### Per-suite Structure
|
122
|
+
|
123
|
+
It can be beneficial to keep different Ansible layouts for different suites. Rather than having to specify the roles, modules, etc for each suite, you can create the following directory structure and they will automatically be found:
|
124
|
+
|
125
|
+
```
|
126
|
+
$kitchen_root/ansible/$suite_name/roles
|
127
|
+
$kitchen_root/ansible/$suite_name/modules
|
128
|
+
$kitchen_root/ansible/$suite_name/Ansiblefile
|
129
|
+
```
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-ansible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.45.
|
4
|
+
version: 0.45.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neill Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: net-ssh
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.0'
|
83
83
|
description: |+
|
@@ -101,7 +101,9 @@ files:
|
|
101
101
|
- lib/kitchen/provisioner/ansible/config.rb
|
102
102
|
- lib/kitchen/provisioner/ansible/librarian.rb
|
103
103
|
- lib/kitchen/provisioner/ansible/os.rb
|
104
|
+
- lib/kitchen/provisioner/ansible/os/alpine.rb
|
104
105
|
- lib/kitchen/provisioner/ansible/os/amazon.rb
|
106
|
+
- lib/kitchen/provisioner/ansible/os/darwin.rb
|
105
107
|
- lib/kitchen/provisioner/ansible/os/debian.rb
|
106
108
|
- lib/kitchen/provisioner/ansible/os/fedora.rb
|
107
109
|
- lib/kitchen/provisioner/ansible/os/redhat.rb
|
@@ -118,17 +120,17 @@ require_paths:
|
|
118
120
|
- lib
|
119
121
|
required_ruby_version: !ruby/object:Gem::Requirement
|
120
122
|
requirements:
|
121
|
-
- -
|
123
|
+
- - ">="
|
122
124
|
- !ruby/object:Gem::Version
|
123
125
|
version: '0'
|
124
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
127
|
requirements:
|
126
|
-
- -
|
128
|
+
- - ">="
|
127
129
|
- !ruby/object:Gem::Version
|
128
130
|
version: '0'
|
129
131
|
requirements: []
|
130
|
-
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
132
|
+
rubyforge_project: "[none]"
|
133
|
+
rubygems_version: 2.2.2
|
132
134
|
signing_key:
|
133
135
|
specification_version: 4
|
134
136
|
summary: ansible provisioner for test-kitchen
|