-
Notifications
You must be signed in to change notification settings - Fork 14
/
p_presetup-storage.yml
124 lines (105 loc) · 3.37 KB
/
p_presetup-storage.yml
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
#- name: Setup of Folders and SELinux for Redis Quay Clair PSql
# block:
# Postgresql
#
#
- name: Setup Container Runtime Storage
hosts:
- postgres
gather_facts: no
tasks:
# name: Create Postgres User
# block:
# - name: Create pre-defined postgres group
# group:
# name: "{{ postgres_runtime_group }}"
# gid: "{{ postgres_runtime_gid }}"
# - name: Create pre-defined postgres user
# user:
# name: "{{ postgres_runtime_user }}"
# group: "{{ postgres_runtime_group }}"
# uid: "{{ postgres_runtime_uid }}"
# shell: /bin/bash
# home: "{{ postgres_runtime_home }}"
# comment: "PostgreSQL Container"
- name: Create new mountpoints
file:
path: "{{ data_dir_base }}"
state: directory
mode: 0777
- name: Create Postgres Container Directories for Postgresql
file:
path: "{{ item }}"
state: directory
owner: "{{ postgres_folder_owner }}"
group: "{{ postgres_folder_group }}"
mode: "{{ postgres_folder_permissions }}"
with_items:
- "{{ data_dir_base }}"
- "{{ postgres_data_dir }}/data"
# - "{{ postgres_data_dir }}/data/userdata"
- name: Set selinux context for container data
sefcontext:
target: "{{ item }}"
setype: svirt_sandbox_file_t
state: present
register: sefcontext_status
with_items:
- "{{ data_dir_base }}/.*"
- name: Apply selinux context for container data
when: sefcontext_status.changed
shell: "restorecon -irv {{ item }}"
with_items:
- "{{ data_dir_base }}"
# Quay
#
#
- name: Setup Container Runtime Storage for Quay
hosts:
- quay
gather_facts: no
tasks:
- name: Create new mountpoints
file:
path: "{{ data_dir_base }}"
state: directory
mode: 0777
- name: "Set selinux context for container data"
sefcontext:
target: "{{ item }}"
setype: svirt_sandbox_file_t
state: present
register: sefcontext_status
with_items:
- "{{ data_dir_base }}/.*"
- name: "Apply selinux context for container data"
when: sefcontext_status.changed
shell: "restorecon -irv {{ item }}"
with_items:
- "{{ data_dir_base }}"
# Redis
#
#
- name: Setup Container Runtime Storage for Redis
hosts:
- redis
gather_facts: no
tasks:
- name: Create new mountpoints
file:
path: "{{ data_dir_base }}"
state: directory
mode: 0777
- name: "Set selinux context for container data"
sefcontext:
target: "{{ item }}"
setype: svirt_sandbox_file_t
state: present
register: sefcontext_status
with_items:
- "{{ data_dir_base }}/.*"
- name: "Apply selinux context for container data"
when: sefcontext_status.changed
shell: "restorecon -irv {{ item }}"
with_items:
- "{{ data_dir_base }}"