-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_install_quobyte_server.yaml
123 lines (102 loc) · 3.78 KB
/
00_install_quobyte_server.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
- hosts: quobyteservers
any_errors_fatal: false
vars_files:
- vars/ansible-vars
become: yes
vars:
# You can set explicit Quobyte versions here, for example to do a rollback
# *.deb version schema
## quobyte_version: =2:3.0~pre9.1-1
# *.rpm version schema:
## quobyte_version: "-3.1-8.1"
quobyte_version: ""
tasks:
- set_fact:
package_url: https://packages.quobyte.com/repo/3/{{ repo_id }}
when: repo_id is defined
- set_fact:
package_url: https://packages.quobyte.com/repo/current
when: repo_id is not defined
- set_fact:
rpm_distribution_string: "RHEL"
when: ansible_distribution is regex('^RedHat*')
- set_fact:
rpm_distribution_string: "RHEL"
when: ansible_distribution is regex('^OracleLinux*')
- set_fact:
rpm_distribution_string: "RockyLinux"
when: ansible_distribution is regex('^Rocky*')
- set_fact:
rpm_distribution_string: "CentOS"
when: ansible_distribution is regex('^CentOS*')
- set_fact:
rpm_distribution_string: "SLE"
when: ansible_distribution is regex('SLES')
- name: Add Quobyte repository signing key
apt_key:
url: "{{ dedicated_mirror | default(package_url) }}/apt/pubkey.gpg"
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Add Quobyte apt repository to sources list
apt_repository:
repo: "deb {{ dedicated_mirror | default(package_url) }}/apt {{ ansible_distribution_release }} main"
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Add Quobyte YUM repository to sources list
yum_repository:
name: quobyte
description: Quobyte rpm repo
baseurl: "{{ dedicated_mirror | default(package_url) }}/rpm/{{ rpm_distribution_string }}_{{ ansible_distribution_major_version }}"
gpgkey: "{{ dedicated_mirror | default(package_url) }}/rpm/{{ rpm_distribution_string }}_{{ ansible_distribution_major_version }}/repodata/repomd.xml.key"
gpgcheck: "{{ check_package_signature | default('yes', true) }}"
when: ansible_facts['os_family'] == "RedHat"
- name: Add Quobyte Zypper repository to sources list
zypper_repository:
name: quobyte
description: Quobyte rpm repo
repo: "{{ dedicated_mirror | default(package_url) }}/rpm/{{ rpm_distribution_string }}_{{ ansible_distribution_major_version }}"
auto_import_keys: yes
disable_gpg_check: "{{ check_packages_signature | default('no', false) }}"
when: ansible_facts['os_family'] == "Suse"
- name: Install Debian packages
apt:
name: "{{ packages }}"
state: present
update_cache: yes
allow_unauthenticated: "{{ check_packages_signature | default('no', false) }}"
vars:
packages:
- openjdk-17-jre-headless
- quobyte-server{{ quobyte_version }}
- xfsprogs
when: ansible_facts['os_family'] == "Debian"
- name: Install RPM packages
yum:
update_cache: yes
allow_downgrade: yes
state: present
name: "{{ packages }}"
vars:
packages:
- java-17-openjdk
- quobyte-server{{ quobyte_version }}
- xfsprogs
when: ansible_facts['os_family'] == "RedHat"
- name: Install RPM packages on Suse Linux
zypper:
update_cache: yes
oldpackage: yes
state: present
name: "{{ packages }}"
vars:
packages:
- java-17-openjdk
- quobyte-server
- xfsprogs
- tuned
- chrony
when: ansible_facts['os_family'] == "Suse"
- name: Write /etc/quobyte/host.cfg
template:
src: templates/host.cfg.jinja2
dest: "/etc/quobyte/host.cfg"