diff options
Diffstat (limited to 'roles/etcd/tasks/backup')
| -rw-r--r-- | roles/etcd/tasks/backup/backup.yml | 16 | ||||
| -rw-r--r-- | roles/etcd/tasks/backup/copy.yml | 2 | ||||
| -rw-r--r-- | roles/etcd/tasks/backup/unarchive.yml | 2 | ||||
| -rw-r--r-- | roles/etcd/tasks/backup/vars.yml | 5 | 
4 files changed, 11 insertions, 14 deletions
| diff --git a/roles/etcd/tasks/backup/backup.yml b/roles/etcd/tasks/backup/backup.yml index ec1a1989c..ca0d29155 100644 --- a/roles/etcd/tasks/backup/backup.yml +++ b/roles/etcd/tasks/backup/backup.yml @@ -3,7 +3,7 @@  # TODO: replace shell module with command and update later checks  - name: Check available disk space for etcd backup -  shell: df --output=avail -k {{ l_etcd_data_dir }} | tail -n 1 +  shell: df --output=avail -k {{ etcd_data_dir }} | tail -n 1    register: l_avail_disk    # AUDIT:changed_when: `false` because we are only inspecting    # state, not manipulating anything @@ -11,7 +11,7 @@  # TODO: replace shell module with command and update later checks  - name: Check current etcd disk usage -  shell: du --exclude='*openshift-backup*' -k {{ l_etcd_data_dir }} | tail -n 1 | cut -f1 +  shell: du --exclude='*openshift-backup*' -k {{ etcd_data_dir }} | tail -n 1 | cut -f1    register: l_etcd_disk_usage    # AUDIT:changed_when: `false` because we are only inspecting    # state, not manipulating anything @@ -44,17 +44,17 @@    - r_etcd_common_embedded_etcd | bool    - not l_ostree_booted.stat.exists | bool -- name: Check selinux label of '{{ l_etcd_data_dir }}' +- name: Check selinux label of '{{ etcd_data_dir }}'    command: > -    stat -c '%C' {{ l_etcd_data_dir }} +    stat -c '%C' {{ etcd_data_dir }}    register: l_etcd_selinux_labels  - debug:      msg: "{{ l_etcd_selinux_labels }}" -- name: Make sure the '{{ l_etcd_data_dir }}' has the proper label +- name: Make sure the '{{ etcd_data_dir }}' has the proper label    command: > -    chcon -t svirt_sandbox_file_t  "{{ l_etcd_data_dir }}" +    chcon -t svirt_sandbox_file_t  "{{ etcd_data_dir }}"    when:    - l_etcd_selinux_labels.rc == 0    - "'svirt_sandbox_file_t' not in l_etcd_selinux_labels.stdout" @@ -68,12 +68,12 @@  # https://github.com/openshift/openshift-docs/commit/b38042de02d9780842dce95cfa0ef45d53b58bc6  - name: Check for v3 data store    stat: -    path: "{{ l_etcd_data_dir }}/member/snap/db" +    path: "{{ etcd_data_dir }}/member/snap/db"    register: l_v3_db  - name: Copy etcd v3 data store    command: > -    cp -a {{ l_etcd_data_dir }}/member/snap/db +    cp -a {{ etcd_data_dir }}/member/snap/db      {{ l_etcd_backup_dir }}/member/snap/    when: l_v3_db.stat.exists diff --git a/roles/etcd/tasks/backup/copy.yml b/roles/etcd/tasks/backup/copy.yml index 16604bae8..967e5ee66 100644 --- a/roles/etcd/tasks/backup/copy.yml +++ b/roles/etcd/tasks/backup/copy.yml @@ -2,4 +2,4 @@  - name: Copy etcd backup    copy:      src: "{{ etcd_backup_sync_directory }}/{{ l_backup_dir_name }}.tgz" -    dest: "{{ l_etcd_data_dir }}" +    dest: "{{ etcd_data_dir }}" diff --git a/roles/etcd/tasks/backup/unarchive.yml b/roles/etcd/tasks/backup/unarchive.yml index 6c75d00a7..a85f533c2 100644 --- a/roles/etcd/tasks/backup/unarchive.yml +++ b/roles/etcd/tasks/backup/unarchive.yml @@ -11,4 +11,4 @@    #   src: "{{ l_etcd_backup_dir }}.tgz"    #   dest: "{{ l_etcd_backup_dir }}"    command: > -    tar -xf "{{ l_etcd_backup_dir }}.tgz" -C "{{ l_etcd_data_dir }}" +    tar -xf "{{ l_etcd_backup_dir }}.tgz" -C "{{ etcd_data_dir }}" diff --git a/roles/etcd/tasks/backup/vars.yml b/roles/etcd/tasks/backup/vars.yml index 3c009f557..3ffa641b3 100644 --- a/roles/etcd/tasks/backup/vars.yml +++ b/roles/etcd/tasks/backup/vars.yml @@ -6,13 +6,10 @@      l_backup_dir_name: "openshift-backup-{{ r_etcd_common_backup_tag }}{{ r_etcd_common_backup_sufix_name }}"  - set_fact: -    l_etcd_data_dir: "{{ etcd_data_dir }}{{ '/etcd.etcd' if r_etcd_common_etcd_runtime == 'runc' else '' }}" - -- set_fact:      l_etcd_incontainer_data_dir: "{{ etcd_data_dir }}"  - set_fact:      l_etcd_incontainer_backup_dir: "{{ l_etcd_incontainer_data_dir }}/{{ l_backup_dir_name }}"  - set_fact: -    l_etcd_backup_dir: "{{ l_etcd_data_dir }}/{{ l_backup_dir_name }}" +    l_etcd_backup_dir: "{{ etcd_data_dir }}/{{ l_backup_dir_name }}" | 
