mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-24 21:51:03 +01:00
Made execution dependent on database parameter
This commit is contained in:
parent
3f4592146a
commit
842ccd54b4
@ -38,6 +38,12 @@
|
|||||||
command:
|
command:
|
||||||
cmd: "python database_entry_seeder.py databases.csv {{database_instance}} {{database_host}} {{database_databasename}} {{database_username}} {{database_password}}"
|
cmd: "python database_entry_seeder.py databases.csv {{database_instance}} {{database_host}} {{database_databasename}} {{database_username}} {{database_password}}"
|
||||||
chdir: "{{backup_docker_to_local_folder}}"
|
chdir: "{{backup_docker_to_local_folder}}"
|
||||||
|
when: >
|
||||||
|
database_instance is defined or
|
||||||
|
database_host is defined or
|
||||||
|
database_databasename is defined or
|
||||||
|
database_username is defined or
|
||||||
|
database_password is defined
|
||||||
|
|
||||||
- name: Set file permissions for databases.csv to be readable, writable, and executable by root only
|
- name: Set file permissions for databases.csv to be readable, writable, and executable by root only
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@ -45,7 +51,19 @@
|
|||||||
mode: '0700'
|
mode: '0700'
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
when: run_once_backup_docker_to_local is not defined
|
when: >
|
||||||
|
(database_instance is defined or
|
||||||
|
database_host is defined or
|
||||||
|
database_databasename is defined or
|
||||||
|
database_username is defined or
|
||||||
|
database_password is defined) and
|
||||||
|
run_once_backup_docker_to_local_file_permission is not defined
|
||||||
|
register: file_permission_result
|
||||||
|
|
||||||
|
- name: run the backup_docker_to_local_file_permission tasks once
|
||||||
|
set_fact:
|
||||||
|
run_once_backup_docker_to_local_file_permission: true
|
||||||
|
when: run_once_backup_docker_to_local_file_permission is not defined and file_permission_result is defined and file_permission_result.changed
|
||||||
|
|
||||||
- name: run the backup_docker_to_local tasks once
|
- name: run the backup_docker_to_local tasks once
|
||||||
set_fact:
|
set_fact:
|
||||||
|
Loading…
Reference in New Issue
Block a user