-
Notifications
You must be signed in to change notification settings - Fork 0
/
os_params.tf
66 lines (66 loc) · 2.75 KB
/
os_params.tf
1
2
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
locals {
os_params = {
"Red Hat" : {
ami_owner = "309956199498"
ami_name = "RHEL-8.6.0_HVM-20240419-x86_64-63-Hourly2-GP3"
ami_ssh_user = "ec2-user"
agent_installation_dir = "/opt/imperva",
installation_filename = "Imperva-ragent-RHEL-v8-kSMP-px86_64-b14.6.0.60.0.637577.bsx"
package_install = <<-EOF
yum update -y
yum install unzip -y
EOF
database_installation_commands = {
PostgreSql = <<-EOF
yum install @postgresql -y
/usr/bin/postgresql-setup --initdb
systemctl start postgresql.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | psql &>/dev/null' | crontab -u postgres -
EOF
MySql = <<-EOF
dnf -y install @mysql
systemctl enable mysqld.service
systemctl start mysqld.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | mysql &>/dev/null' | crontab -
EOF
MariaDB = <<-EOF
yum install mariadb-server -y
#sed -i '/ProtectSystem/d' /usr/lib/systemd/system/mariadb.service
#systemctl daemon-reload
systemctl restart mariadb.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | mysql &>/dev/null' | crontab -
EOF
}
},
"Ubuntu" : {
ami_owner = "099720109477" # Amazon
ami_name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"
ami_ssh_user = "ubuntu"
agent_installation_dir = "/usr/imperva",
installation_filename = "Imperva-ragent-UBN-px86_64-b14.6.0.60.0.636085.bsx"
package_install = <<-EOF
apt update -y
apt install unzip
EOF
database_installation_commands = {
PostgreSql = <<-EOF
apt install postgresql -y
systemctl start postgresql.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | psql &>/dev/null' | crontab -u postgres -
EOF
MySql = <<-EOF
apt install mysql-server -y
systemctl start mysql.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | mysql &>/dev/null' | crontab -
EOF
MariaDB = <<-EOF
apt install mariadb-server -y
sed -i '/ProtectSystem/d' /usr/lib/systemd/system/mariadb.service
systemctl daemon-reload
systemctl restart mariadb.service
echo '* * * * * for i in $(seq 1 500); do echo "select * from dummy;"; done | mariadb --socket=/run/mysqld/mysqld.sock &>/dev/null' | crontab -
EOF
}
}
}
}