Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'/etc/origin/cloudprovider',
'/etc/origin/kubelet-plugins',
'/usr/libexec/kubernetes/kubelet-plugins',
'/var/log/origin',
)

ALLOWED_DIRS_STRING = ', '.join(ALLOWED_DIRS)
Expand Down
2 changes: 2 additions & 0 deletions roles/lib_utils/test/test_master_check_paths_in_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def loaded_config():
'oauthConfig':
{'identityProviders':
['1', '2', '/this/will/fail']},
'auditConfig':
{'auditFilePath': "/var/log/origin/audit-ocp.log"},
'fake_top_item':
{'fake_item':
{'fake_item2':
Expand Down
10 changes: 10 additions & 0 deletions roles/openshift_control_plane/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
mode: '0750'
when: not openshift_is_atomic | bool

- name: Create openshift audit log directory
file:
state: directory
path: "/var/log/origin"
mode: 0700
when:
- openshift.master.audit_config is defined
- openshift.master.audit_config.auditFilePath is defined
- '"/var/log/origin" in openshift.master.audit_config.auditFilePath'

- name: Create the policy file if it does not already exist
command: >
{{ openshift_client_binary }} --config={{ openshift.common.config_base }}/master/admin.kubeconfig
Expand Down
27 changes: 27 additions & 0 deletions roles/openshift_control_plane/tasks/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@
value: "/etc/origin/kubelet-plugins"
when: openshift_is_atomic | bool

- name: Add audit volume to master static pod (api)
yedit:
src: "{{ mktemp.stdout }}/apiserver.yaml"
append: true
key: spec.volumes
value:
name: audit-logs
hostPath:
path: "/var/log/origin"
when:
- openshift.master.audit_config is defined
- openshift.master.audit_config.auditFilePath is defined
- '"/var/log/origin" in openshift.master.audit_config.auditFilePath'

- name: Add audit volumeMounts to master static pod (api)
yedit:
src: "{{ mktemp.stdout }}/apiserver.yaml"
append: true
key: spec.containers[0].volumeMounts
value:
mountPath: "/var/log/origin"
name: audit-logs
when:
- openshift.master.audit_config is defined
- openshift.master.audit_config.auditFilePath is defined
- '"/var/log/origin" in openshift.master.audit_config.auditFilePath'

- name: ensure pod location exists
file:
path: "{{ openshift_control_plane_static_pod_location }}"
Expand Down