Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update k8s_exec and k8s_cp to include container name #1858

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions roles/backup/tasks/awx-cro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
k8s_cp:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
remote_path: "{{ backup_dir }}/awx_object"
content: "{{ awx_spec | to_yaml }}"
1 change: 1 addition & 0 deletions roles/backup/tasks/delete_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: >-
bash -c 'rm -rf {{ backup_dir }}'
3 changes: 3 additions & 0 deletions roles/backup/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: >-
mkdir -p {{ backup_dir }}

- name: Precreate file for database dump
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: >-
touch {{ backup_dir }}/tower.db

Expand Down Expand Up @@ -126,6 +128,7 @@
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: |
bash -c "
function end_keepalive {
Expand Down
1 change: 1 addition & 0 deletions roles/backup/tasks/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
k8s_cp:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
remote_path: "{{ backup_dir }}/secrets.yml"
content: "{{ secrets | to_yaml }}"
no_log: "{{ no_log }}"
1 change: 1 addition & 0 deletions roles/restore/tasks/import_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
k8s_cp:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
remote_path: "{{ backup_dir }}/awx_object"
local_path: "{{ tmp_spec.path }}"
state: from_pod
Expand Down
1 change: 1 addition & 0 deletions roles/restore/tasks/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: >-
bash -c "stat {{ backup_dir }}"
register: stat_backup_dir
Expand Down
1 change: 1 addition & 0 deletions roles/restore/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
k8s_exec:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
command: |
bash -c "
function end_keepalive {
Expand Down
1 change: 1 addition & 0 deletions roles/restore/tasks/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
k8s_cp:
namespace: "{{ backup_pvc_namespace }}"
pod: "{{ ansible_operator_meta.name }}-db-management"
container: "{{ ansible_operator_meta.name }}-db-management"
remote_path: "{{ backup_dir }}/secrets.yml"
local_path: "{{ tmp_secrets.path }}"
state: from_pod
Expand All @@ -33,7 +34,7 @@

- name: If deployment is managed, set the database_host in the pg config secret
block:
- name: Set new database host

Check warning on line 37 in roles/restore/tasks/secrets.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

37:5 [indentation] wrong indentation: expected 2 but found 4

Check warning on line 37 in roles/restore/tasks/secrets.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

37:5 [indentation] wrong indentation: expected 2 but found 4
set_fact:
database_host: "{{ deployment_name }}-postgres-{{ supported_pg_version }}"
no_log: "{{ no_log }}"
Expand Down Expand Up @@ -73,7 +74,7 @@

- name: Set new name for receptor secrets using deployment_name
block:
- name: Set new receptor secret names

Check warning on line 77 in roles/restore/tasks/secrets.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

77:5 [indentation] wrong indentation: expected 2 but found 4

Check warning on line 77 in roles/restore/tasks/secrets.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

77:5 [indentation] wrong indentation: expected 2 but found 4
set_fact:
receptor_ca_name: "{{ deployment_name }}-receptor-ca"
receptor_work_signing_name: "{{ deployment_name }}-receptor-work-signing"
Expand Down
Loading