Class: Kitchen::Provisioner::Ansible::Os::Fedora
Instance Attribute Summary
#name
Instance Method Summary
collapse
#initialize, make, #sudo, #sudo_env
Instance Method Details
#ansible_package_name ⇒ Object
47
48
49
50
51
52
53
|
# File 'lib/kitchen/provisioner/ansible/os/fedora.rb', line 47
def ansible_package_name
if @config[:ansible_version] == 'latest' || @config[:ansible_version] == nil
"ansible"
else
"ansible#{@config[:ansible_version][0..2]}-#{@config[:ansible_version]}"
end
end
|
#install_command ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/kitchen/provisioner/ansible/os/fedora.rb', line 26
def install_command
<<-INSTALL
if [ ! $(which ansible) ]; then
#{redhat_yum_repo}
#{update_packages_command}
FEDORA_RELEASE=$(rpm --query --queryformat="%{VERSION}" --file /etc/fedora-release)
if [ ${FEDORA_RELEASE} -le 28 ]; then
#{sudo_env('dnf')} -y install #{ansible_package_name} libselinux-python git python2-dnf
else
#{sudo_env('dnf')} -y install #{ansible_package_name} python3-libselinux git python3-dnf
fi
fi
INSTALL
end
|
#redhat_yum_repo ⇒ Object
55
56
57
58
59
60
61
|
# File 'lib/kitchen/provisioner/ansible/os/fedora.rb', line 55
def redhat_yum_repo
if @config[:ansible_yum_repo]
<<-INSTALL
#{sudo_env('rpm')} -ivh #{@config[:ansible_yum_repo]}
INSTALL
end
end
|
#update_packages_command ⇒ Object
43
44
45
|
# File 'lib/kitchen/provisioner/ansible/os/fedora.rb', line 43
def update_packages_command
@config[:update_package_repos] ? "#{sudo_env('dnf')} makecache" : nil
end
|