Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3ccfe51
Defer nightly backups, disable ASG processes during syncs and run syn…
EmlynK Jan 20, 2022
a54c09c
Added deploy.yml examples for Drupal 9 and Localgov. Updated tests (#97)
DionisioFG Mar 10, 2022
223a3b5
Adding a new SimpleSAMLphp meta role. (#100)
gregharvey Mar 31, 2022
32843d5
Allowing users to set cachetool version properly. (#102)
gregharvey Apr 13, 2022
91ea64e
Deploy ami pr 1.x (#106)
gregharvey Apr 14, 2022
371b6b9
Making the MySQL dump command for routine back-ups less aggressive. (…
gregharvey Apr 20, 2022
a9cc7ad
Fix database backups pr 1.x (#109)
gregharvey Apr 20, 2022
4c4c3ad
Fix MySQL backup deferral. (#110)
EmlynK Apr 22, 2022
029848d
Files recurse fix pr 1.x (#112)
EmlynK Apr 26, 2022
b71fa83
Improve multisite support (#115)
EmlynK Apr 29, 2022
4b6163b
Attempt to fix static credentials handling when deploying to an ASG.
EmlynK May 23, 2022
10d7b07
Merge branch 'devel' into static-credentials-handling-fix_PR_devel
EmlynK May 23, 2022
8ad76f0
Merge branch 'static-credentials-handling-fix' into static-credential…
EmlynK May 23, 2022
fcb974e
Include build_type in static password file location.
EmlynK May 23, 2022
47f30cb
Merge branch 'static-credentials-handling-fix' into static-credential…
EmlynK May 23, 2022
6f89da1
Move to using new location for static credentials handling, but try t…
EmlynK May 23, 2022
8ccc7d2
Merge branch 'static-credentials-handling-fix' into static-credential…
EmlynK May 23, 2022
cd2967a
Add a couple of comments to legacy handling of static credentials.
EmlynK May 23, 2022
c0e38f1
Merge branch 'static-credentials-handling-fix' into static-credential…
EmlynK May 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion roles/database_backup/database_backup-mysql/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,55 @@
- set_fact:
_mysql_build_user_name: "{{ database.user }}"
when: mysql_backup.credentials_handling == 'static'

### Start of legacy handling. Can remove in a few months.
- name: Catch legacy static password handling.
ansible.builtin.stat:
path: "{{ _ce_deploy_data_dir }}/{{ inventory_hostname }}/mysql/{{ _mysql_host }}/{{ database.database }}"
register: _legacy_static_creds
delegate_to: localhost
run_once: true
when: mysql_backup.credentials_handling == 'static'

- name: Create new static password location if it doesn't exist.
ansible.builtin.file:
path: "{{ _ce_deploy_data_dir }}/{{ project_name }}_{{ build_type }}/mysql/{{ _mysql_host }}"
state: directory
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
mode: 0755
delegate_to: localhost
run_once: true
when: mysql_backup.credentials_handling == 'static'

- name: Copy legacy static password to new location.
ansible.builtin.copy:
src: "{{ _ce_deploy_data_dir }}/{{ inventory_hostname }}/mysql/{{ _mysql_host }}/{{ database.database }}"
dest: "{{ _ce_deploy_data_dir }}/{{ project_name }}_{{ build_type }}/mysql/{{ _mysql_host }}/{{ database.database }}"
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
mode: 0644
delegate_to: localhost
run_once: true
when:
- mysql_backup.credentials_handling == 'static'
- _legacy_static_creds is defined
- _legacy_static_creds.stat.exists

- name: Delete legacy static password file if it exists.
ansible.builtin.file:
path: "{{ _ce_deploy_data_dir }}/{{ inventory_hostname }}/mysql/{{ _mysql_host }}/{{ database.database }}"
state: absent
delegate_to: localhost
run_once: true
when:
- mysql_backup.credentials_handling == 'static'
- _legacy_static_creds is defined
- _legacy_static_creds.stat.exists
### End of legacy handling.

- set_fact:
_mysql_build_password: "{{ lookup('password', '{{ _ce_deploy_data_dir }}/{{ inventory_hostname }}/mysql/{{ _mysql_host }}/{{ database.database }}') }}"
_mysql_build_password: "{{ lookup('password', '{{ _ce_deploy_data_dir }}/{{ project_name }}_{{ build_type }}/mysql/{{ _mysql_host }}/{{ database.database }}') }}"
when: mysql_backup.credentials_handling == 'static'
# Rotate: create user/pwd on each build.
- set_fact:
Expand Down