diff --git a/tasks/configure_nfs_mounts.yml b/tasks/configure_nfs_mounts.yml index ae07eb539d91b85cbabbdedbc396a9ef842ce35b..435cb871752e391d4f14233c91db6fc6127f2009 100644 --- a/tasks/configure_nfs_mounts.yml +++ b/tasks/configure_nfs_mounts.yml @@ -16,9 +16,6 @@ - "{{ paths.log_disapp.mountpoint }}" - "{{ paths.log_subapp.mountpoint }}" - "{{ paths.log_subapp_ws.mountpoint }}" - # - "/var/log/rosetta/{{ ansible_hostname }}/disapp/" - # - "/var/log/rosetta/{{ ansible_hostname }}/subapp/" - # - "/var/log/rosetta/{{ ansible_hostname }}/legacy/" register: stat_result - name: if dir doesn't exist, create it with correct permissions ansible.builtin.file: @@ -30,23 +27,17 @@ loop: "{{ stat_result.results }}" when: not item.stat.exists -# - name: Mounts für SubApp-Shares & Logs LEGACY -# ansible.posix.mount: -# path: "{{ item.path }}" -# src: "{{ item.src | default(omit) }}" -# state: "{{ item.state | default('mounted') }}" -# fstype: nfs -# opts: "{{ item.opts | default( nfs_opts.v3 ) }}" -# loop: -# # LEGACY -> remove -# # we remove this mount in favor of separate mounts for logging ingests and access (but we can only do this once the rollout has happened and the sub-/dissapp are logging to their new locations, because otherwise the "Device is busy", so think of this as preparation) -# #- path: "/var/log/subapp/{{ ansible_hostname }}" -# # state: unmounted -# # ... and replace it with a temporary mount that we can use to access old logs until they've been migrated to their new log directories. -# - path: "/var/log/rosetta/{{ ansible_hostname }}/" -# src: "{{ nfs_mounts_subapp.hosts[ansible_hostname]['log_disapp']['nfs_share'] }}{{ ansible_hostname }}" -# opts: "{{ nfs_mounts_subapp.hosts[ansible_hostname]['log_disapp']['nfs_opts'] }}" -# tags: [notest] +- name: Mounts für SubApp-Shares & Logs LEGACY + ansible.posix.mount: + path: "{{ item.path }}" + state: "absent" + loop: + # LEGACY -> remove + # we remove this mount in favor of separate mounts for logging ingests and access (but we can only do this once the rollout has happened and the sub-/dissapp are logging to their new locations, because otherwise the "Device is busy", so think of this as preparation) + - path: "/var/log/subapp/{{ ansible_hostname }}" + - path: "/var/log/subapp_ws/" + tags: [notest] + ignore_errors: true - name: Mounts für SubApp-Shares & Logs NEW ansible.posix.mount: diff --git a/tasks/install_subapp.yml b/tasks/install_subapp.yml index 814114f3835e3a554b0e02669efb5f6a1b7baf1d..1cee9d12028ab9798d3ea5e8563e5f7a71800d02 100644 --- a/tasks/install_subapp.yml +++ b/tasks/install_subapp.yml @@ -176,8 +176,12 @@ - "/home/{{ vault_subapp_user }}/.subapp/lockdir" - "/home/{{ vault_disapp_user }}/.disapp/lockdir" -# Softlinks für SubApp-Konfigurationen und nach /var/log setzen -- name: Softlinks für SubApp-Konfigurationen und nach /var/log setzen +- name: Symlinks zu alten Loglocations bereinigen + ansible.builtin.file: + path: "/home/{{ vault_subapp_user }}/.subapp/{{ ansible_hostname }}" + state: absent + +- name: Symlinks für SubApp-Konfigurationen und nach /var/log setzen ansible.builtin.file: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -191,7 +195,7 @@ dest: "/home/{{ vault_disapp_user }}/.disapp.cfg" owner: "{{ vault_disapp_user }}" group: "{{ vault_disapp_group }}" - - src: "/var/log/disapp/" + - src: "{{ paths.log_disapp.mountpoint }}" dest: "/home/{{ vault_disapp_user }}/.disapp/disapp_logs" owner: "{{ vault_disapp_user }}" group: "{{ vault_disapp_group }}" @@ -200,12 +204,12 @@ dest: "/home/{{ vault_subapp_user }}/.subapp.cfg" owner: "{{ vault_subapp_user }}" group: "{{ vault_subapp_group }}" - - src: "/var/log/subapp/" + - src: "{{ paths.log_subapp.mountpoint }}" dest: "/home/{{ vault_subapp_user }}/.subapp/subapp_logs" owner: "{{ vault_subapp_user }}" group: "{{ vault_subapp_group }}" # Webservice - - src: "/var/log/subapp_ws/" + - src: "{{ paths.log_subapp_ws.mountpoint }}" dest: "/home/{{ vault_subapp_user }}/.subapp/subapp_ws_logs" owner: "{{ vault_subapp_user }}" group: "{{ vault_subapp_group }}"