-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_optional_add_s3services.yaml
64 lines (53 loc) · 1.55 KB
/
08_optional_add_s3services.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
- hosts: s3services
vars_files:
- vars/ansible-vars
become: yes
tasks:
- name: Create object storage working directory
file:
path: /var/lib/quobyte/.quobyte
state: directory
owner: quobyte
- name: Enable Quobyte S3 proxy
service:
enabled: yes
state: started
name: "{{ item }}"
with_items:
- quobyte-s3
- 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: Register systemconfig
shell:
cmd: cat /tmp/systemconfig
register: systemconfig
- name: Add s3 config to systemconfig
lineinfile:
path: /tmp/systemconfig
regexp: '^ hostname:.*'
line: ' hostname: "{{ s3_endpoint }}"'
insertafter: 's3_proxy {'
- name: Add s3 browser bucket name to systemconfig
lineinfile:
path: /tmp/systemconfig
line: ' browser_bucket_name: "browser"'
regexp: '^ browser_bucket_name:.*'
insertafter: 's3_proxy {'
- name: Import system configuration
shell:
cmd: /usr/bin/qmgmt -u {{ api_service }} systemconfig import /tmp/systemconfig
tags: system
- hosts: s3services
become: yes
tasks:
- name: Restart Quobyte S3 services
service:
enabled: yes
state: restarted
name: "{{ item }}"
with_items:
- quobyte-s3