X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=infra%2Fcleanup_admin_user_access%2Fplaybooks%2Fcleanup-admin-user-access.yaml;fp=infra%2Fcleanup_admin_user_access%2Fplaybooks%2Fcleanup-admin-user-access.yaml;h=15378065a3f08ef298ee3fb5d6def1cc1326bac1;hb=2a38ae7ee9e01513553823f2bdacd8e0d8a89349;hp=0000000000000000000000000000000000000000;hpb=c9fd62a2092c43f290610172f475342954b3c061;p=infra%2Ftools.git diff --git a/infra/cleanup_admin_user_access/playbooks/cleanup-admin-user-access.yaml b/infra/cleanup_admin_user_access/playbooks/cleanup-admin-user-access.yaml new file mode 100644 index 0000000..1537806 --- /dev/null +++ b/infra/cleanup_admin_user_access/playbooks/cleanup-admin-user-access.yaml @@ -0,0 +1,46 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2021 The Nordix Foundation. All rights reserved. +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +- hosts: baremetal + gather_facts: true + become: false + + tasks: + - name: Remove admin user ssh keys + file: + path: /root/.ssh/{{ item }} + state: absent + with_items: + - id_rsa + - id_rsa.pub + - authorized_keys + +- hosts: jumphost + gather_facts: true + become: false + + tasks: + - name: Remove admin user ssh keys + file: + path: /root/.ssh/{{ item }} + state: absent + with_items: + - id_rsa + - id_rsa.pub + - authorized_keys