-
Notifications
You must be signed in to change notification settings - Fork 0
/
06_optional_install_defaultclient.yaml
121 lines (101 loc) · 3.66 KB
/
06_optional_install_defaultclient.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
- hosts: clients
vars_files:
- vars/ansible-vars
become: yes
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/v3
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:
- quobyte-client
- tuned
when: ansible_facts['os_family'] == "Debian"
- name: Install RPM packages
yum:
update_cache: yes
allow_downgrade: yes
state: present
name: "{{ packages }}"
vars:
packages:
- quobyte-client
- tuned
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:
- quobyte-client
- tuned
when: ansible_facts['os_family'] == "Suse"
- name: Write /etc/quobyte/client-service.cfg
template:
src: templates/client-service.cfg.jinja2
dest: "/etc/quobyte/client-service.cfg"
- name: Create client mount point /quobyte
file:
path: /quobyte
state: directory
owner: quobyte
- name: Enable Quobyte client service
service:
enabled: yes
state: started
name: "{{ item }}"
with_items:
- quobyte-client