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

[1.5 backport] set the proper label of /var/lib/etcd directory #4690

Merged
Merged
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
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