diff --git a/roles/livy/common/tasks/jmx-exporter.yml b/roles/livy/common/tasks/jmx-exporter.yml index 2a14e7e4..ff054b81 100644 --- a/roles/livy/common/tasks/jmx-exporter.yml +++ b/roles/livy/common/tasks/jmx-exporter.yml @@ -2,18 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: Ensure configuration directory - ansible.builtin.file: - path: "{{ livy_jmx_exporter_conf_dir }}" - state: directory - owner: "{{ livy_user }}" - group: "{{ hadoop_group }}" - mode: "750" - - name: Render jmx-exporter config file ansible.builtin.copy: content: "{{ jmx_exporter | to_nice_yaml }}" - dest: "{{ livy_jmx_exporter_conf_dir }}/{{ livy_jmx_exporter_conf_file }}" + dest: "{{ livy_root_conf_dir }}/{{ livy_jmx_exporter_conf_file }}" owner: "{{ livy_user }}" group: "{{ hadoop_group }}" mode: "600" diff --git a/roles/livy/server/tasks/config.yml b/roles/livy/server/tasks/config.yml index 7dc7286f..84018a89 100644 --- a/roles/livy/server/tasks/config.yml +++ b/roles/livy/server/tasks/config.yml @@ -1,9 +1,4 @@ --- -- name: Check if livy config exists - ansible.builtin.stat: - path: "{{ livy_server_conf_dir }}/" - register: livy_config - - name: Backup configuration ansible.builtin.copy: src: "{{ livy_server_conf_dir }}/" @@ -12,15 +7,7 @@ owner: "{{ livy_user }}" mode: "755" remote_src: yes - when: livy_config.stat.exists - -- name: Ensure livy config dir exists - ansible.builtin.file: - path: "{{ livy_server_conf_dir }}/" - state: directory - group: root - owner: root - mode: "755" + tags: ['backup', 'never'] - name: Template livy-env.sh ansible.builtin.template: diff --git a/roles/livy/server/tasks/install.yml b/roles/livy/server/tasks/install.yml index 8d5458c9..a8ed4d4b 100644 --- a/roles/livy/server/tasks/install.yml +++ b/roles/livy/server/tasks/install.yml @@ -62,6 +62,14 @@ mode: "750" recurse: yes +- name: Create config directory + ansible.builtin.file: + path: "{{ livy_server_conf_dir }}/" + state: directory + group: "{{ hadoop_group }}" + owner: "{{ livy_user }}" + mode: "755" + - name: Template Livy Server service file ansible.builtin.template: src: livy-server.service.j2 diff --git a/tdp_vars_defaults/livy-spark3/livy-spark3.yml b/tdp_vars_defaults/livy-spark3/livy-spark3.yml index c17f4581..796f679f 100644 --- a/tdp_vars_defaults/livy-spark3/livy-spark3.yml +++ b/tdp_vars_defaults/livy-spark3/livy-spark3.yml @@ -70,10 +70,9 @@ livy_conf: livy.server.recovery.zk-state-store.key-prefix: "livy{{ spark_version }}" # jmx exporter config -livy_jmx_exporter_conf_dir: "/etc/livy-spark3" livy_jmx_exporter_conf_file: "jmx-exporter.yml" exporter_livy_http_port: "{{ exporter_livy_spark3_http_port }}" -jmx_exporter_opts: "{% if 'exporter_jmx' in groups and groups['exporter_jmx'] %}-javaagent:{{ jmx_exporter_install_file }}={{ exporter_livy_spark3_http_port }}:{{ livy_jmx_exporter_conf_dir }}/{{ livy_jmx_exporter_conf_file }}{% endif %}" +jmx_exporter_opts: "{% if 'exporter_jmx' in groups and groups['exporter_jmx'] %}-javaagent:{{ jmx_exporter_install_file }}={{ exporter_livy_spark3_http_port }}:{{ livy_root_conf_dir }}/{{ livy_jmx_exporter_conf_file }}{% endif %}" jmx_exporter: startDelaySeconds: 0 diff --git a/tdp_vars_defaults/livy/livy.yml b/tdp_vars_defaults/livy/livy.yml index 7f95b18e..9d7384f6 100644 --- a/tdp_vars_defaults/livy/livy.yml +++ b/tdp_vars_defaults/livy/livy.yml @@ -70,10 +70,9 @@ livy_conf: livy.server.recovery.zk-state-store.key-prefix: "livy{{ spark_version }}" # jmx exporter config -livy_jmx_exporter_conf_dir: "/etc/livy" livy_jmx_exporter_conf_file: "jmx-exporter.yml" exporter_livy_http_port: "{{ exporter_livy_spark_http_port }}" -jmx_exporter_opts: "{% if 'exporter_jmx' in groups and groups['exporter_jmx'] %}-javaagent:{{ jmx_exporter_install_file }}={{ exporter_livy_spark_http_port }}:{{ livy_jmx_exporter_conf_dir }}/{{ livy_jmx_exporter_conf_file }}{% endif %}" +jmx_exporter_opts: "{% if 'exporter_jmx' in groups and groups['exporter_jmx'] %}-javaagent:{{ jmx_exporter_install_file }}={{ exporter_livy_spark_http_port }}:{{ livy_root_conf_dir }}/{{ livy_jmx_exporter_conf_file }}{% endif %}" jmx_exporter: startDelaySeconds: 0 lowercaseOutputName: false