Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
drupal
Commits
315ad4fe
Commit
315ad4fe
authored
8 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-inventories/arocom#28 Implement site specific mysql users and password as an option
parent
8231a9d8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/install.yml
+13
-0
13 additions, 0 deletions
tasks/install.yml
templates/d6_settings.php
+1
-1
1 addition, 1 deletion
templates/d6_settings.php
templates/d7_settings.php
+4
-4
4 additions, 4 deletions
templates/d7_settings.php
with
18 additions
and
5 deletions
tasks/install.yml
+
13
−
0
View file @
315ad4fe
...
...
@@ -177,5 +177,18 @@
state='present'
with_items
:
'
{{
drupal.domains
}}'
# TODO: We should also do the below user config for all extra db's of each domain if present.
-
name
:
"
Create
MySQL
User"
mysql_user
:
user='{{ item.0.db.username|default("root") }}'
password='{{ item.0.db.password|default(mysql_root_password) }}'
host='{{ item.1 }}'
check_implicit_admin=yes
priv='{{ item.0.db.name }}.*:ALL'
with_nested
:
-
'
{{
drupal.domains
}}'
-
[
'
localhost'
,
'
127.0.0.1'
,
'
::1'
,
'
{{
inventory_hostname
}}'
]
notify
:
"
MySQL
|
Restart
MySQL"
-
name
:
"
Set
Extended
Permissions"
command
:
setfacl -dRm u:{{ apacheUser }}:rwX,g:{{ apacheUser }}:rwX,o::rX {{ webRoot }}/files
This diff is collapsed.
Click to expand it.
templates/d6_settings.php
+
1
−
1
View file @
315ad4fe
<?php
$db_url
=
'mysql://
root:{{
mysql_root_password }}@127.0.0.1/{{ item.db.name }}'
;
$db_url
=
'mysql://
{{ item.db.username|default("root") }}:{{ item.db.password|default(
mysql_root_password
)
}}@127.0.0.1/{{ item.db.name }}'
;
$db_prefix
=
'{{ item.db.prefix|default("") }}'
;
$update_free_access
=
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
templates/d7_settings.php
+
4
−
4
View file @
315ad4fe
...
...
@@ -5,8 +5,8 @@ $databases = array (
'default'
=>
array
(
'driver'
=>
'{{ item.db.driver|default("mysql") }}'
,
'database'
=>
'{{ item.db.name }}'
,
'username'
=>
'
root
'
,
'password'
=>
'{{ mysql_root_password }}'
,
'username'
=>
'
{{ item.db.username|default("root") }}
'
,
'password'
=>
'{{
item.db.password|default(
mysql_root_password
)
}}'
,
'host'
=>
'{{ item.db.host|default("127.0.0.1") }}'
,
'port'
=>
'{{ hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"][0]["local"] }}'
,
),
...
...
@@ -16,8 +16,8 @@ $databases = array (
'default'
=>
array
(
'driver'
=>
'{{ db.driver|default("mysql") }}'
,
'database'
=>
'{{ db.name }}'
,
'username'
=>
'
root
'
,
'password'
=>
'{{ mysql_root_password }}'
,
'username'
=>
'
{{ db.username|default(item.db.username|default("root")) }}
'
,
'password'
=>
'{{
db.password|default(item.db.password|default(
mysql_root_password
))
}}'
,
'host'
=>
'{{ item.db.host|default("127.0.0.1") }}'
,
'port'
=>
'{{ hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"][0]["local"] }}'
,
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment