-
Notifications
You must be signed in to change notification settings - Fork 0
/
pg-install-rocky8.yaml
126 lines (107 loc) · 3.62 KB
/
pg-install-rocky8.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
- name: Setup the PG-Strom to Rocky Linux 8.8
hosts: home
become: true
tasks:
- name: Install the 'Development tools' package group.
ansible.builtin.dnf:
name: '@Development tools'
state: present
- name: Upgrade all packages
ansible.builtin.dnf:
name: "*"
state: latest
- name: Install the perl-IPC-Run package from the powertools repo
ansible.builtin.dnf:
name: perl-IPC-Run
enablerepo: powertools
state: present
- name: Install the kernel, kernel-dev and headers.
ansible.builtin.dnf:
name:
- kernel-core >= 4.18.0-477
- kernel-devel >= 4.18.0-477
- kernel-headers >= 4.18.0-477
state: present
- name: Install the grubby.
ansible.builtin.dnf:
name:
- grubby
state: present
- name: Config the GRUB.
ansible.builtin.shell:
cmd: "grubby --update-kernel=ALL --args='nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off'"
- name: Install the epel-release rpm from a remote repo
ansible.builtin.dnf:
name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm'
state: present
disable_gpg_check: true
- name: Install the HeteroDB Software Distribution Center rpm from a remote repo.
ansible.builtin.dnf:
name: "https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm"
state: present
disable_gpg_check: true
- name: Install the CUDA 12.2.2 package repos rpm from a remote repo.
ansible.builtin.dnf:
name: "https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda-repo-rhel8-12-2-local-12.2.2_535.104.05-1.x86_64.rpm"
state: present
disable_gpg_check: true
- name: Install the CUDA Drivers.
ansible.builtin.shell:
cmd: "dnf -y module install nvidia-driver:latest-dkms"
- name: Install the CUDA.
ansible.builtin.dnf:
name:
- cuda
state: present
update_cache: true
disable_gpg_check: true
- name: Reboot a machine that might have lots of updates to apply
ansible.builtin.reboot:
reboot_timeout: 180
- name: Install the PostgreSQL package repos rpm from a remote repo.
ansible.builtin.dnf:
name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
state: present
disable_gpg_check: true
- name: Disable the PostgreSQL Module Packages.
ansible.builtin.shell:
cmd: "dnf -y module disable postgresql"
- name: Install the PGDG's PostgreSQL Packages and Extra.
ansible.builtin.dnf:
name:
- postgresql15-devel
- postgresql15-server
- postgresql-alternatives
- pg_strom-PG15
state: present
update_cache: true
disable_gpg_check: true
- name: Init DB
ansible.builtin.shell:
cmd: "/usr/pgsql-15/bin/postgresql-15-setup initdb"
chdir: /var/lib/pgsql/15/data/
creates: PG_VERSION
- name: Add include setting
ansible.builtin.blockinfile:
path: /var/lib/pgsql/15/data/postgresql.conf
block: |
include 'postgresql.custom.conf'
owner: postgres
group: postgres
mode: '0644'
state: present
- name: Copy the Postgres setting file
ansible.builtin.copy:
src: src/postgresql.custom.conf
dest: /var/lib/pgsql/15/data/postgresql.custom.conf
owner: postgres
group: postgres
mode: '0644'
- name: Service Restart
ansible.builtin.service:
name: postgresql-15
state: restarted
- name: Print message
ansible.builtin.debug:
msg: "Setup Successful."