Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
databases
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
infra
ansible-shared
databases
Commits
c2f7a183
Commit
c2f7a183
authored
5 years ago
by
Lars Beckers
Browse files
Options
Downloads
Patches
Plain Diff
mysql: move passwordstore lookup from tasks to variables
parent
22448f7b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mysql/defaults/main.yml
+4
-0
4 additions, 0 deletions
mysql/defaults/main.yml
mysql/tasks/main.yml
+3
-6
3 additions, 6 deletions
mysql/tasks/main.yml
with
7 additions
and
6 deletions
mysql/defaults/main.yml
0 → 100644
+
4
−
0
View file @
c2f7a183
---
# yamllint disable-line rule:line-length
mysql_root_password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
This diff is collapsed.
Click to expand it.
mysql/tasks/main.yml
+
3
−
6
View file @
c2f7a183
...
@@ -37,11 +37,9 @@
...
@@ -37,11 +37,9 @@
-
name
:
ensure the mysql root user exists and has the correct password
-
name
:
ensure the mysql root user exists and has the correct password
mysql_user
:
mysql_user
:
name
:
root
name
:
root
# yamllint disable-line rule:line-length
password
:
"
{{
mysql_root_password
}}"
password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
login_user
:
root
login_user
:
root
# yamllint disable-line rule:line-length
login_password
:
"
{{
mysql_root_password
}}"
login_password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
register
:
mysql_root_creation_result
register
:
mysql_root_creation_result
no_log
:
true
no_log
:
true
ignore_errors
:
true
ignore_errors
:
true
...
@@ -52,8 +50,7 @@
...
@@ -52,8 +50,7 @@
-
name
:
initialize the mysql root user
-
name
:
initialize the mysql root user
mysql_user
:
mysql_user
:
name
:
root
name
:
root
# yamllint disable-line rule:line-length
password
:
"
{{
mysql_root_password
}}"
password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
no_log
:
true
no_log
:
true
when
:
mysql_root_creation_result|failed
when
:
mysql_root_creation_result|failed
tags
:
tags
:
...
...
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