Skip to content

Commit

Permalink
[WIP] Add db open command
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed Oct 17, 2019
1 parent c043cfd commit 2f6186f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions templates/db_credentials.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"web_user": {{ web_user }},
"ansible_host": {{ ansible_host }},
"ansible_port": {{ ansible_port | default('22') }},
"db_user": {{ site_env.db_user }},
"db_password": {{ site_env.db_password }},
"db_host": {{ site_env.db_host }},
"db_name": {{ site_env.db_name }},
"wp_env": {{ site_env.wp_env }}
}
18 changes: 18 additions & 0 deletions templates/dump_db_credentials_yml.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package templates

const DUMP_DB_CREDENTIALS_YML = `
---
- name: 'Trellis CLI: Dump database credentials'
hosts: web:&{{ env }}
remote_user: "{{ web_user }}"
gather_facts: false
connection: local
tasks:
- name: Dump database credentials
template:
src: db_credentials.json.j2
dest: "{{ dest }}"
mode: '0600'
with_dict: "{{ wordpress_sites }}"
when: item.key == site
`

0 comments on commit 2f6186f

Please sign in to comment.