-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sitewards/ADHOC-add-post-import
Adhoc add post import
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
--- | ||
- include: "dependencies.yml" | ||
- include: "import.yml" | ||
|
||
- name: "Run post import quries" | ||
include: "post_import.yml" | ||
with_items: "{{ import_db_post_import_sql_queries }}" | ||
loop_control: | ||
loop_var: "import_db_post_import_sql_query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: "Execute sql query" | ||
command: > | ||
env MYSQL_PWD={{ import_db_root_password }} | ||
mysql --user=root {{ import_db_database_name }} | ||
--execute="{{ import_db_post_import_sql_query.query }}" | ||
no_log: true | ||
ignore_errors: true | ||
register: import_db_post_import_sql_query_result | ||
|
||
- debug: | ||
msg: '{{ import_db_post_import_sql_query_result.stderr | regex_replace(import_db_root_password) }}' | ||
when: import_db_post_import_sql_query_result.stderr != "" | ||
|
||
- debug: | ||
msg: '{{ import_db_post_import_sql_query_result.stdout | regex_replace(import_db_root_password) }}' | ||
when: import_db_post_import_sql_query_result.stdout != "" | ||
|
||
- fail: | ||
msg: "error in sql querry" | ||
when: import_db_post_import_sql_query_result.stderr != "" |