-
Notifications
You must be signed in to change notification settings - Fork 0
/
10_optional_use_qns_for_s3_eval.yaml
72 lines (63 loc) · 1.66 KB
/
10_optional_use_qns_for_s3_eval.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
- hosts: registryservices[0]
vars_files:
- vars/ansible-vars
become: yes
tasks:
- name: Get Quobyte session
shell:
cmd: qmgmt -u {{ api_service }} user login {{ admin_user }} {{ admin_password }}
- name: Export systemconfig
shell:
cmd: qmgmt -u {{ api_service }} systemconfig export /tmp/systemconfig
- name: Add qns section to systemconfig
blockinfile:
path: /tmp/systemconfig
block: |
qns_config {
id: "{{ qns_id }}"
secret: "{{ qns_secret }}"
}
- name: Import systemconfig
shell:
cmd: qmgmt -u {{ api_service }} systemconfig import /tmp/systemconfig
- hosts: registryservices
vars_files:
- vars/ansible-vars
become: yes
tasks:
- name: Restart Quobyte registries
service:
state: restarted
name: "{{ item }}"
with_items:
- quobyte-registry
- hosts: s3services
become: yes
vars_files:
- vars/ansible-vars
tasks:
- name: Get public ip
uri:
url: http://ip.syseleven.de
return_content: yes
register: ipaddress
- set_fact:
public_ip: "public_ip = {{ ipaddress.content | trim }}"
- debug:
var: public_ip
- name: Add qns config
lineinfile:
path: /etc/quobyte/s3.cfg
state: present
line: "qns.id = {{ qns_id }}"
- name: Add public_ip config
lineinfile:
path: /etc/quobyte/s3.cfg
state: present
line: "{{ public_ip }}"
- name: Restart Quobyte S3 proxy
service:
state: restarted
name: "{{ item }}"
with_items:
- quobyte-s3