Skip to content

Commit

Permalink
ADHOC [feat]: add support for custom mysql port
Browse files Browse the repository at this point in the history
  Currently there is no support for custom mysql ports. Magento can be configured with port as part of the host directive,
  however this is not valid for operations performed directly on the cli.

  To solve the issue we are introducing declaration of port when required, this is optional and backwards compatible.
  • Loading branch information
Svetlin Kalendzhiev committed Aug 20, 2021
1 parent d0951eb commit 8eeb9a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ magento_mode: "default"
# password: ""
# host: ""
# name: ""
# port: ""

## The database connections that contain the Magento data that Magento accesses
## See http://devdocs.magento.com/guides/v2.0/config-guide/config/config-php.html
Expand Down
4 changes: 2 additions & 2 deletions tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
- name: "Check if Magento database exists"
shell:
cmd: |
mysql --user="{{ magento_config_db.username }}" --password="{{ magento_config_db.password }}" --database="{{ magento_config_db.name }}" --host="{{ magento_config_db.host }}" <<EOF
mysql --user="{{ magento_config_db.username }}" --password="{{ magento_config_db.password }}" --database="{{ magento_config_db.name }}" --host="{{ magento_config_db.host }}" --port="{{ magento_config_db.port | default('3306') }}" <<EOF
SHOW TABLES LIKE 'core_config_data';
EOF
register: magento_db_status
Expand All @@ -184,7 +184,7 @@
- name: "Enforce core configuration data"
shell:
cmd: |
mysql --user="{{ magento_config_db.username }}" --password="{{ magento_config_db.password }}" --database="{{ magento_config_db.name }}" --host="{{ magento_config_db.host }}" <<EOF
mysql --user="{{ magento_config_db.username }}" --password="{{ magento_config_db.password }}" --database="{{ magento_config_db.name }}" --host="{{ magento_config_db.host }}" --port="{{ magento_config_db.port | default('3306') }}" <<EOF
INSERT INTO core_config_data (path, scope, scope_id, value)
VALUES (
'{{ item.path }}',
Expand Down

0 comments on commit 8eeb9a2

Please sign in to comment.