-
Notifications
You must be signed in to change notification settings - Fork 0
/
pg-install-rhel8-el8.6.yaml
132 lines (113 loc) · 4.03 KB
/
pg-install-rhel8-el8.6.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
127
128
129
130
131
132
---
- name: Setup the PG-Strom to Red Hat Enterprise Linux 8.6
hosts: home
become: true
tasks:
- name: Set the Release
ansible.builtin.shell:
cmd: "subscription-manager release --set=8.6"
when:
- ansible_facts['distribution'] == "RedHat"
- ansible_facts['distribution_major_version'] == "8"
- name: Install the 'Development tools' package group.
ansible.builtin.dnf:
name: '@Development tools'
state: present
- name: Install the kernel, kernel-dev and headers.
ansible.builtin.dnf:
name:
- kernel-core >= 4.18.0-372
- kernel-devel >= 4.18.0-372
- kernel-headers >= 4.18.0-372
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: Enable the Codeready.
ansible.builtin.shell:
cmd: "subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms"
when:
- ansible_facts['distribution'] == "RedHat"
- ansible_facts['distribution_major_version'] == "8"
- 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.0.0 package repos rpm from a remote repo.
ansible.builtin.dnf:
name: "https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda-repo-rhel8-12-0-local-12.0.0_525.60.13-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 12.0.0.
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-15.3-1PGDG.rhel8
- postgresql15-server-15.3-1PGDG.rhel8
- postgresql15-devel-15.3-1PGDG.rhel8
- postgresql15-libs-15.3-1PGDG.rhel8
- postgresql15-contrib-15.3-1PGDG.rhel8
- 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."