kitchen-ansible 0.49.0 → 0.49.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +270 -270
- data/kitchen-ansible.gemspec +35 -35
- data/lib/kitchen-ansible/version.rb +6 -6
- data/lib/kitchen/provisioner/ansible/config.rb +198 -197
- data/lib/kitchen/provisioner/ansible/librarian.rb +78 -78
- data/lib/kitchen/provisioner/ansible/os.rb +84 -84
- data/lib/kitchen/provisioner/ansible/os/alpine.rb +42 -42
- data/lib/kitchen/provisioner/ansible/os/amazon.rb +42 -42
- data/lib/kitchen/provisioner/ansible/os/darwin.rb +37 -37
- data/lib/kitchen/provisioner/ansible/os/debian.rb +75 -75
- data/lib/kitchen/provisioner/ansible/os/fedora.rb +60 -60
- data/lib/kitchen/provisioner/ansible/os/freebsd.rb +34 -34
- data/lib/kitchen/provisioner/ansible/os/openbsd.rb +36 -36
- data/lib/kitchen/provisioner/ansible/os/redhat.rb +80 -80
- data/lib/kitchen/provisioner/ansible/os/suse.rb +44 -44
- data/lib/kitchen/provisioner/ansible_playbook.rb +1239 -1239
- data/provisioner_options.md +269 -268
- metadata +3 -3
@@ -1,37 +1,37 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2015 Michael Heap
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
module Kitchen
|
21
|
-
module Provisioner
|
22
|
-
module Ansible
|
23
|
-
class Os
|
24
|
-
class Darwin < Os
|
25
|
-
|
26
|
-
def install_command
|
27
|
-
<<-INSTALL
|
28
|
-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null
|
29
|
-
/usr/local/bin/brew install ansible
|
30
|
-
INSTALL
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2015 Michael Heap
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Kitchen
|
21
|
+
module Provisioner
|
22
|
+
module Ansible
|
23
|
+
class Os
|
24
|
+
class Darwin < Os
|
25
|
+
|
26
|
+
def install_command
|
27
|
+
<<-INSTALL
|
28
|
+
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null
|
29
|
+
/usr/local/bin/brew install ansible
|
30
|
+
INSTALL
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,75 +1,75 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2015 Michael Heap
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
module Kitchen
|
21
|
-
module Provisioner
|
22
|
-
module Ansible
|
23
|
-
class Os
|
24
|
-
class Debian < Os
|
25
|
-
def update_packages_command
|
26
|
-
@config[:update_package_repos] ? "#{sudo_env('apt-get')} update" : nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def ansible_debian_version
|
30
|
-
if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
|
31
|
-
''
|
32
|
-
else
|
33
|
-
"=#{@config[:ansible_version]}"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def install_command
|
38
|
-
<<-INSTALL
|
39
|
-
|
40
|
-
if [ ! $(which ansible) ]; then
|
41
|
-
#{update_packages_command}
|
42
|
-
|
43
|
-
## Install apt-utils to silence debconf warning: http://serverfault.com/q/358943/77156
|
44
|
-
## Install dirmngr to handle GPG key management for stretch, addressing https://github.com/neillturner/kitchen-ansible/issues/257
|
45
|
-
#{sudo_env('apt-get')} -y install apt-utils git dirmngr
|
46
|
-
|
47
|
-
## Fix debconf tty warning messages
|
48
|
-
export DEBIAN_FRONTEND=noninteractive
|
49
|
-
|
50
|
-
if [ -f /etc/os-release ] && [ `grep 'ID=debian' /etc/os-release` ]; then
|
51
|
-
#{sudo_env('echo')} "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
|
52
|
-
#{sudo_env('apt-key')} adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
53
|
-
else
|
54
|
-
## 13.10, 14.04 include add-apt-repository in software-properties-common
|
55
|
-
#{sudo_env('apt-get')} -y install software-properties-common
|
56
|
-
|
57
|
-
## 10.04, 12.04 include add-apt-repository in
|
58
|
-
#{sudo_env('apt-get')} -y install python-software-properties
|
59
|
-
|
60
|
-
## 10.04 version of add-apt-repository doesn't accept --yes
|
61
|
-
## later versions require interaction from user, so we must specify --yes
|
62
|
-
## First try with -y flag, else if it fails, try without.
|
63
|
-
## "add-apt-repository: error: no such option: -y" is returned but is ok to ignore, we just retry
|
64
|
-
#{sudo_env('add-apt-repository')} -y #{@config[:ansible_apt_repo]} || #{sudo_env('add-apt-repository')} #{@config[:ansible_apt_repo]}
|
65
|
-
fi
|
66
|
-
#{sudo_env('apt-get')} update
|
67
|
-
#{sudo_env('apt-get')} -y install ansible#{ansible_debian_version}
|
68
|
-
fi
|
69
|
-
INSTALL
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2015 Michael Heap
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Kitchen
|
21
|
+
module Provisioner
|
22
|
+
module Ansible
|
23
|
+
class Os
|
24
|
+
class Debian < Os
|
25
|
+
def update_packages_command
|
26
|
+
@config[:update_package_repos] ? "#{sudo_env('apt-get')} update" : nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def ansible_debian_version
|
30
|
+
if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
|
31
|
+
''
|
32
|
+
else
|
33
|
+
"=#{@config[:ansible_version]}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def install_command
|
38
|
+
<<-INSTALL
|
39
|
+
|
40
|
+
if [ ! $(which ansible) ]; then
|
41
|
+
#{update_packages_command}
|
42
|
+
|
43
|
+
## Install apt-utils to silence debconf warning: http://serverfault.com/q/358943/77156
|
44
|
+
## Install dirmngr to handle GPG key management for stretch, addressing https://github.com/neillturner/kitchen-ansible/issues/257
|
45
|
+
#{sudo_env('apt-get')} -y install apt-utils git dirmngr
|
46
|
+
|
47
|
+
## Fix debconf tty warning messages
|
48
|
+
export DEBIAN_FRONTEND=noninteractive
|
49
|
+
|
50
|
+
if [ -f /etc/os-release ] && [ `grep 'ID=debian' /etc/os-release` ]; then
|
51
|
+
#{sudo_env('echo')} "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
|
52
|
+
#{sudo_env('apt-key')} adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
53
|
+
else
|
54
|
+
## 13.10, 14.04 include add-apt-repository in software-properties-common
|
55
|
+
#{sudo_env('apt-get')} -y install software-properties-common
|
56
|
+
|
57
|
+
## 10.04, 12.04 include add-apt-repository in
|
58
|
+
#{sudo_env('apt-get')} -y install python-software-properties
|
59
|
+
|
60
|
+
## 10.04 version of add-apt-repository doesn't accept --yes
|
61
|
+
## later versions require interaction from user, so we must specify --yes
|
62
|
+
## First try with -y flag, else if it fails, try without.
|
63
|
+
## "add-apt-repository: error: no such option: -y" is returned but is ok to ignore, we just retry
|
64
|
+
#{sudo_env('add-apt-repository')} -y #{@config[:ansible_apt_repo]} || #{sudo_env('add-apt-repository')} #{@config[:ansible_apt_repo]}
|
65
|
+
fi
|
66
|
+
#{sudo_env('apt-get')} update
|
67
|
+
#{sudo_env('apt-get')} -y install ansible#{ansible_debian_version}
|
68
|
+
fi
|
69
|
+
INSTALL
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -1,60 +1,60 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
-
# Mark McKinstry
|
5
|
-
#
|
6
|
-
# Copyright (C) 2015 Michael Heap
|
7
|
-
#
|
8
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
|
21
|
-
module Kitchen
|
22
|
-
module Provisioner
|
23
|
-
module Ansible
|
24
|
-
class Os
|
25
|
-
class Fedora < Os
|
26
|
-
def install_command
|
27
|
-
<<-INSTALL
|
28
|
-
|
29
|
-
if [ ! $(which ansible) ]; then
|
30
|
-
#{redhat_yum_repo}
|
31
|
-
#{update_packages_command}
|
32
|
-
#{sudo_env('dnf')} -y install #{ansible_package_name} libselinux-python git python2-dnf
|
33
|
-
fi
|
34
|
-
INSTALL
|
35
|
-
end
|
36
|
-
|
37
|
-
def update_packages_command
|
38
|
-
@config[:update_package_repos] ? "#{sudo_env('dnf')} makecache" : nil
|
39
|
-
end
|
40
|
-
|
41
|
-
def ansible_package_name
|
42
|
-
if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
|
43
|
-
"ansible"
|
44
|
-
else
|
45
|
-
"ansible#{@config[:ansible_version][0..2]}-#{@config[:ansible_version]}"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def redhat_yum_repo
|
50
|
-
if @config[:ansible_yum_repo]
|
51
|
-
<<-INSTALL
|
52
|
-
#{sudo_env('rpm')} -ivh #{@config[:ansible_yum_repo]}
|
53
|
-
INSTALL
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Michael Heap (<m@michaelheap.com>)
|
4
|
+
# Mark McKinstry
|
5
|
+
#
|
6
|
+
# Copyright (C) 2015 Michael Heap
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Kitchen
|
22
|
+
module Provisioner
|
23
|
+
module Ansible
|
24
|
+
class Os
|
25
|
+
class Fedora < Os
|
26
|
+
def install_command
|
27
|
+
<<-INSTALL
|
28
|
+
|
29
|
+
if [ ! $(which ansible) ]; then
|
30
|
+
#{redhat_yum_repo}
|
31
|
+
#{update_packages_command}
|
32
|
+
#{sudo_env('dnf')} -y install #{ansible_package_name} libselinux-python git python2-dnf
|
33
|
+
fi
|
34
|
+
INSTALL
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_packages_command
|
38
|
+
@config[:update_package_repos] ? "#{sudo_env('dnf')} makecache" : nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def ansible_package_name
|
42
|
+
if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
|
43
|
+
"ansible"
|
44
|
+
else
|
45
|
+
"ansible#{@config[:ansible_version][0..2]}-#{@config[:ansible_version]}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def redhat_yum_repo
|
50
|
+
if @config[:ansible_yum_repo]
|
51
|
+
<<-INSTALL
|
52
|
+
#{sudo_env('rpm')} -ivh #{@config[:ansible_yum_repo]}
|
53
|
+
INSTALL
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -1,34 +1,34 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Tomoyuki Sakurai
|
4
|
-
#
|
5
|
-
# Copyright (C) 2018 Tomoyuki Sakurai
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
module Kitchen
|
21
|
-
module Provisioner
|
22
|
-
module Ansible
|
23
|
-
class Os
|
24
|
-
class Freebsd < Os
|
25
|
-
def install_command
|
26
|
-
<<-INSTALL
|
27
|
-
pkg install -y ansible
|
28
|
-
INSTALL
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Tomoyuki Sakurai
|
4
|
+
#
|
5
|
+
# Copyright (C) 2018 Tomoyuki Sakurai
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Kitchen
|
21
|
+
module Provisioner
|
22
|
+
module Ansible
|
23
|
+
class Os
|
24
|
+
class Freebsd < Os
|
25
|
+
def install_command
|
26
|
+
<<-INSTALL
|
27
|
+
pkg install -y ansible
|
28
|
+
INSTALL
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,36 +1,36 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Marcin Wolny (<marcin@wutanic.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2015 Marcin Wolny
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
module Kitchen
|
21
|
-
module Provisioner
|
22
|
-
module Ansible
|
23
|
-
class Os
|
24
|
-
class Openbsd < Os
|
25
|
-
|
26
|
-
def install_command
|
27
|
-
<<-INSTALL
|
28
|
-
sudo pkg_add ansible--
|
29
|
-
INSTALL
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Marcin Wolny (<marcin@wutanic.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2015 Marcin Wolny
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Kitchen
|
21
|
+
module Provisioner
|
22
|
+
module Ansible
|
23
|
+
class Os
|
24
|
+
class Openbsd < Os
|
25
|
+
|
26
|
+
def install_command
|
27
|
+
<<-INSTALL
|
28
|
+
sudo pkg_add ansible--
|
29
|
+
INSTALL
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|