Skip to content

Commit

Permalink
set the proper label of /var/lib/etcd directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvagabund committed Jul 6, 2017
1 parent 1b33481 commit 7c045ef
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions playbooks/common/openshift-cluster/upgrades/etcd/backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@
- embedded_etcd | bool
- not openshift.common.is_atomic | bool

- name: Check selinux label of '{{ openshift.etcd.etcd_data_dir }}'
command: >
stat -c '%C' {{ openshift.etcd.etcd_data_dir }}
register: l_etcd_selinux_labels

- debug:
msg: "{{ l_etcd_selinux_labels }}"

- name: Make sure the '{{ openshift.etcd.etcd_data_dir }}' has the proper label
command: >
chcon -t svirt_sandbox_file_t "{{ openshift.etcd.etcd_data_dir }}"
when:
- l_etcd_selinux_labels.rc == 0
- "'svirt_sandbox_file_t' not in l_etcd_selinux_labels.stdout"

- name: Generate etcd backup
command: >
{{ etcdctl_command }} backup --data-dir={{ openshift.etcd.etcd_data_dir }}
Expand Down

0 comments on commit 7c045ef

Please sign in to comment.