-
Notifications
You must be signed in to change notification settings - Fork 0
/
13_optional_add_nfsservices.yaml
89 lines (74 loc) · 2.57 KB
/
13_optional_add_nfsservices.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
- hosts: nfsservices
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*')
- name: Make sure Quobyte repository signing key exists
apt_key:
url: https://packages.quobyte.com/repo/v3/apt/pubkey.gpg
state: present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Make sure Quobyte deb package repository exists
apt_repository:
repo: "deb {{ package_url }}/apt {{ ansible_distribution_release }} main"
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Make sure Quobyte rpm package repository exists
yum_repository:
name: quobyte
description: Quobyte rpm repo
baseurl: "{{ package_url }}/rpm/{{ rpm_distribution_string }}_{{ ansible_distribution_major_version }}"
gpgkey: https://packages.quobyte.com/repo/v3/rpm/{{ rpm_distribution_string }}_{{ ansible_distribution_major_version }}/repodata/repomd.xml.key
when: ansible_facts['os_family'] == "RedHat"
- name: Install Debian packages
apt:
name: "{{ packages }}"
state: present
update_cache: yes
vars:
packages:
- quobyte-nfs
when: ansible_facts['os_family'] == "Debian"
- name: Install RPM packages
yum:
update_cache: yes
allow_downgrade: yes
state: present
name: "{{ packages }}"
vars:
packages:
- quobyte-nfs
when: ansible_facts['os_family'] == "RedHat"
- name: Ensure Registry configuration is set
template:
src: templates/host.cfg.jinja2
dest: "/etc/quobyte/host.cfg"
- name: Ensure config file exists
file:
path: /etc/quobyte/nfs.cfg
state: touch
- name: Enable Quobyte NFS proxy
service:
enabled: yes
state: started
name: "{{ item }}"
with_items:
- quobyte-nfs