Skip to content

Commit 55bd096

Browse files
committed
Install required packages and locales before installation
1 parent bdc0cd4 commit 55bd096

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

plans/subplans/install.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
)
238238
}
239239

240+
run_task('peadm::preinstall', $all_targets)
241+
240242
if $pe_installer_source {
241243
$pe_tarball_name = $pe_installer_source.split('/')[-1]
242244
$pe_tarball_source = $pe_installer_source

tasks/preinstall.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"puppet_task_version": 1,
3+
"supports_noop": false,
4+
"description": "Installs required packages, and configuration required before PE can be installed.",
5+
"implementations": [
6+
{"name": "preinstall.sh"}
7+
]
8+
}

tasks/preinstall.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
# Setup required packages
4+
packages="curl gnupg"
5+
if command -v apt-get >/dev/null 2>&1; then
6+
apt-get update
7+
apt-get install -y ${packages} locales
8+
9+
# Generate en_US.UTF-8 locale for PuppetDB
10+
if ! locale-gen en_US.UTF-8; then
11+
echo "Failed to generate locale en_US.UTF-8" >&2
12+
exit 1
13+
fi
14+
elif command -v yum >/dev/null 2>&1; then
15+
yum install -y ${packages} glibc-langpack-en
16+
else
17+
echo "No supported package manager found (apt-get or yum required)." >&2
18+
exit 1
19+
fi
20+
21+
exit 0

0 commit comments

Comments
 (0)