forked from openshift/openshift-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openshift#3932 from richm/mux
Merged by openshift-bot
- Loading branch information
Showing
14 changed files
with
413 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
- set_fact: mux_ops_host={{ (openshift_logging_use_ops | bool) | ternary(openshift_logging_es_ops_host, openshift_logging_es_host) }} | ||
check_mode: no | ||
|
||
- set_fact: mux_ops_port={{ (openshift_logging_use_ops | bool) | ternary(openshift_logging_es_ops_port, openshift_logging_es_port) }} | ||
check_mode: no | ||
|
||
- name: Check mux current replica count | ||
command: > | ||
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get dc/logging-mux | ||
-o jsonpath='{.spec.replicas}' -n {{openshift_logging_namespace}} | ||
register: mux_replica_count | ||
when: not ansible_check_mode | ||
ignore_errors: yes | ||
changed_when: no | ||
|
||
- name: Generating mux deploymentconfig | ||
template: src=mux.j2 dest={{mktemp.stdout}}/templates/logging-mux-dc.yaml | ||
vars: | ||
component: mux | ||
logging_component: mux | ||
deploy_name: "logging-{{component}}" | ||
image: "{{openshift_logging_image_prefix}}logging-fluentd:{{openshift_logging_image_version}}" | ||
es_host: logging-es | ||
es_port: "{{openshift_logging_es_port}}" | ||
ops_host: "{{ mux_ops_host }}" | ||
ops_port: "{{ mux_ops_port }}" | ||
mux_cpu_limit: "{{openshift_logging_mux_cpu_limit}}" | ||
mux_memory_limit: "{{openshift_logging_mux_memory_limit}}" | ||
replicas: "{{mux_replica_count.stdout | default (0)}}" | ||
mux_node_selector: "{{openshift_logging_mux_nodeselector | default({})}}" | ||
check_mode: no | ||
changed_when: no | ||
|
||
- name: "Check mux hostmount-anyuid permissions" | ||
command: > | ||
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig | ||
get scc/hostmount-anyuid -o jsonpath='{.users}' | ||
register: mux_hostmount_anyuid | ||
check_mode: no | ||
changed_when: no | ||
|
||
- name: "Set hostmount-anyuid permissions for mux" | ||
command: > | ||
{{ openshift.common.admin_binary}} --config={{ mktemp.stdout }}/admin.kubeconfig policy | ||
add-scc-to-user hostmount-anyuid system:serviceaccount:{{openshift_logging_namespace}}:aggregated-logging-fluentd | ||
register: mux_output | ||
failed_when: "mux_output.rc == 1 and 'exists' not in mux_output.stderr" | ||
check_mode: no | ||
when: mux_hostmount_anyuid.stdout.find("system:serviceaccount:{{openshift_logging_namespace}}:aggregated-logging-fluentd") == -1 | ||
|
||
- name: "Check mux cluster-reader permissions" | ||
command: > | ||
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig | ||
get clusterrolebinding/cluster-readers -o jsonpath='{.userNames}' | ||
register: mux_cluster_reader | ||
check_mode: no | ||
changed_when: no | ||
|
||
- name: "Set cluster-reader permissions for mux" | ||
command: > | ||
{{ openshift.common.admin_binary}} --config={{ mktemp.stdout }}/admin.kubeconfig policy | ||
add-cluster-role-to-user cluster-reader system:serviceaccount:{{openshift_logging_namespace}}:aggregated-logging-fluentd | ||
register: mux2_output | ||
failed_when: "mux2_output.rc == 1 and 'exists' not in mux2_output.stderr" | ||
check_mode: no | ||
when: mux_cluster_reader.stdout.find("system:serviceaccount:{{openshift_logging_namespace}}:aggregated-logging-fluentd") == -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Checking for {{ shared_key_info.procure_component }}_shared_key | ||
stat: path="{{generated_certs_dir}}/{{ shared_key_info.procure_component }}_shared_key" | ||
register: component_shared_key_file | ||
check_mode: no | ||
|
||
- name: Trying to discover shared key variable name for {{ shared_key_info.procure_component }} | ||
set_fact: procure_component_shared_key={{ lookup('env', '{{shared_key_info.procure_component}}' + '_shared_key') }} | ||
when: | ||
- shared_key_info[ shared_key_info.procure_component + '_shared_key' ] is defined | ||
check_mode: no | ||
|
||
- name: Creating shared_key for {{ shared_key_info.procure_component }} | ||
copy: content="{{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'|random_word(64)}}" | ||
dest="{{generated_certs_dir}}/{{shared_key_info.procure_component}}_shared_key" | ||
check_mode: no | ||
when: | ||
- not component_shared_key_file.stat.exists | ||
|
||
- name: Copying shared key for {{ shared_key_info.procure_component }} to generated certs directory | ||
copy: content="{{procure_component_shared_key}}" dest="{{generated_certs_dir}}/{{shared_key_info.procure_component}}_shared_key" | ||
check_mode: no | ||
when: | ||
- shared_key_info[ shared_key_info.procure_component + '_shared_key' ] is defined | ||
- not component_shared_key_file.stat.exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.