Clean up legacy lsycnd, rsync and ssh key config

These are no longer needed when a shared filesystem is used to
syncronise the repo server contents

Change-Id: I3109bd891d4c6b3522f5f741d9970093b1e882c8
This commit is contained in:
Jonathan Rosser 2022-04-14 12:51:31 +01:00 committed by Dmitriy Rabotyagov
parent 03b55edaae
commit 45d07fcf0c
2 changed files with 66 additions and 0 deletions

View File

@ -29,6 +29,11 @@
tags:
- always
# TODO (jrosser) Remove this task for the Z release
- include: repo_sync_cleanup.yml
tags:
- repo_server-install
- include: repo_pre_install.yml
tags:
- repo_server-install

View File

@ -0,0 +1,61 @@
---
# Copyright 2022, BBC R&D
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Check rsyncd status
command: systemctl status "{{ rsyncd_service_name }}"
register: _rsyncd_status
failed_when: false
changed_when: false
- name: Stop and uninstall rsyncd when service unit exists with or without error
block:
- name: Stop rsyncd
service:
name: "{{ rsyncd_service_name }}"
state: stopped
enabled: no
- name: Uninstall rsyncd
package:
name: "{{ rsyncd_service_name }}"
state: absent
when: rsyncd_service_name == 'rsyncd'
when: _rsyncd_status.rc == 0 or _rsyncd_status.rc == 3
- name: Check lsyncd status
command: systemctl status lsyncd
register: _lsyncd_status
failed_when: false
changed_when: false
- name: Stop and uninstall lsyncd when service unit exists with or without error
block:
- name: Stop lsyncd
service:
name: lsyncd
enabled: no
- name: Uninstall lsyncd
package:
name: "lsyncd"
state: absent
when: _lsyncd_status.rc == 0 or _lsyncd_status.rc == 3
- name: Remove ssh keys and certificates
file:
path: "{{ repo_service_home_folder }}/.ssh"
state: absent