3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
|
# File 'modules/openstack/manifests/clientpackages/antelope/buster.pp', line 3
class openstack::clientpackages::antelope::buster(
) {
$py2packages = [
'python-novaclient',
'python-glanceclient',
'python-keystoneclient',
'python-openstackclient',
'python-designateclient',
'python-neutronclient',
]
$py3packages = [
'python3-novaclient',
'python3-glanceclient',
'python3-keystoneauth1',
'python3-keystoneclient',
# Openstacksdk is needed only to ensure the patch to it is applied in order
# once the patch is not needed can be removed
'python3-openstacksdk',
'python3-openstackclient',
'python3-troveclient',
'python3-designateclient',
'python3-neutronclient',
'python3-osc-placement',
'python3-tenacity',
]
$otherpackages = [
'ebtables',
'python-netaddr',
'patch',
]
ensure_packages($py2packages + $py3packages + $otherpackages)
# Wrapper python class to easily query openstack clients
file { '/usr/lib/python2.7/dist-packages/mwopenstackclients.py':
ensure => 'present',
source => 'puppet:///modules/openstack/clientpackages/py2/mwopenstackclients.py',
mode => '0755',
owner => 'root',
group => 'root',
}
file { '/usr/lib/python3/dist-packages/mwopenstackclients.py':
ensure => 'present',
source => 'puppet:///modules/openstack/clientpackages/mwopenstackclients.py',
mode => '0755',
owner => 'root',
group => 'root',
}
# Apply https://review.opendev.org/c/openstack/openstacksdk/+/893283
$instance_dir_to_patch = '/usr/lib/python3/dist-packages/openstack'
$instance_patch_file = "${instance_dir_to_patch}.patch"
file {$instance_patch_file:
source => 'puppet:///modules/openstack/antelope/openstacksdk/hacks/allow_overriding_cloud_yaml.patch',
owner => 'root',
group => 'root',
mode => '0644',
}
exec { "apply ${instance_patch_file}":
command => "/usr/bin/patch --forward --strip=2 --directory=${instance_dir_to_patch} --input=${instance_patch_file}",
unless => "/usr/bin/patch --reverse --strip=2 --dry-run -f --directory=${instance_dir_to_patch} --input=${instance_patch_file}",
require => [File[$instance_patch_file], Package['python3-openstacksdk']],
}
}
|