Skip to content

Commit 3f6a12d

Browse files
committed
Merge pull request #95 from sebfie/develop
Socket for mysql connection
2 parents 9596ce7 + 848def3 commit 3f6a12d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ is calculated.
174174
- Options: "mysql", "postgresql"
175175
- Default (varies based on `type`)
176176

177+
* `gitlab['database']['socket']`
178+
- The socket to use for connection
179+
- Default /var/run/mysqld/mysqld.sock
180+
177181
* `gitlab['database']['encoding']`
178182
- The database encoding
179183
- Default (varies based on `type`)

attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
default['gitlab']['database']['encoding'] = node['gitlab']['database']['type'] == 'mysql' ? 'utf8' : 'unicode'
5151
default['gitlab']['database']['collation'] = 'utf8_general_ci'
5252
default['gitlab']['database']['host'] = '127.0.0.1'
53+
default['gitlab']['database']['socket'] = '/var/run/mysqld/mysqld.sock'
5354
default['gitlab']['database']['pool'] = 5
5455
default['gitlab']['database']['database'] = 'gitlab'
5556
default['gitlab']['database']['username'] = 'gitlab'

recipes/mysql.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@
4545
database_password = node['gitlab']['database']['password']
4646
database_userhost = node['gitlab']['database']['userhost']
4747
database_host = node['gitlab']['database']['host']
48+
database_host = node['gitlab']['database']['socket']
4849
database_connection = {
4950
host: database_host,
5051
username: 'root',
51-
password: node['mysql']['server_root_password']
52+
password: node['mysql']['server_root_password'],
53+
socket: node['mysql']['socket']
5254
}
5355

5456
# Create the database

0 commit comments

Comments
 (0)