Browse Source

Adding mariadb service management

2.6.2/master
Philippe Caseiro 1 year ago
parent
commit
c1ff249d3e
2 changed files with 11 additions and 9 deletions
  1. 2
    2
      creolefuncs/mariadb.py
  2. 9
    7
      dicos/25_bdd_server.xml

+ 2
- 2
creolefuncs/mariadb.py View File

@@ -6,8 +6,8 @@ def getMemoryPercentage(percent):
6 6
         percent = int(percent)
7 7
         totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
8 8
         memoryToUse = (totalMemory*percent)/100
9
-        memoryMb = memoryToUse/(1024.**2)
10
-        return "{0}M".format(int(memoryMb))
9
+        memoryMb = int(memoryToUse/(1024.**2))
10
+        return "{0}M".format(memoryMb)
11 11
     except:
12 12
         return "Error during memory percentage calculation"
13 13
 

+ 9
- 7
dicos/25_bdd_server.xml View File

@@ -2,6 +2,7 @@
2 2
 	<files>
3 3
 		<file filelist='dbCluster' name='/etc/mysql/conf.d/galera.cnf' rm='True' mkdir='True'/>
4 4
 		<file filelist='dbTunning' name='/etc/mysql/conf.d/tunning.cnf' rm='True' mkdir='True'/>
5
+		<service servicelist='bdd'>mariadb</service>
5 6
 		<service_access service='mariadb'>
6 7
 			<port service_accesslist='mariadb' protocol='tcp'>3306</port>
7 8
             <tcpwrapper service_accesslist='mariadb'>mariadb</tcpwrapper>
@@ -153,6 +154,14 @@
153 154
 			<param name='mismatch'>""</param>
154 155
 		</fill>
155 156
 
157
+		<condition name='disabled_if_in' source="dbEnable">
158
+			<param>non</param>
159
+			<target type='family'>Database Cluster</target>
160
+			<target type='family'>Database</target>
161
+			<target type='service_accesslist'>dbCluster</target>
162
+			<target type='servicelist'>bdd</target>
163
+		</condition>
164
+
156 165
 		<condition name='disabled_if_in' source="dbCreateFixAdmin">
157 166
 			<param>non</param>
158 167
 			<target type='variable'>accName</target>
@@ -167,13 +176,6 @@
167 176
 			<target type='filelist'>dbCluster</target>
168 177
 		</condition>
169 178
 
170
-		<condition name='disabled_if_in' source="dbEnable">
171
-			<param>non</param>
172
-			<target type='family'>Database Cluster</target>
173
-			<target type='family'>Database</target>
174
-			<target type='service_accesslist'>dbCluster</target>
175
-		</condition>
176
-
177 179
 		<condition name='disabled_if_in' source="dbCacheQueryEnable">
178 180
 			<param>non</param>
179 181
 			<target type='variable'>dbQueryCacheLimit</target>

Loading…
Cancel
Save