--- # Copyright Red Hat, Inc. # 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. - name: Install podman and configure session linger ansible.builtin.import_role: name: podman - name: Stop and remove vbmc container containers.podman.podman_container: name: "{{ cifmw_virtualbmc_container_name }}" state: absent - name: Remove vbmc container image containers.podman.podman_image: name: "{{ cifmw_virtualbmc_image }}" state: absent - name: Check if VBMC key exists register: _vbmc_ssh_stat ansible.builtin.stat: path: "{{ cifmw_virtualbmc_sshkey_path }}.pub" - name: Revoke VBMC temporary key when: - _vbmc_ssh_stat.stat.exists block: - name: Slurp key register: _vbmc_key ansible.builtin.slurp: path: "{{ cifmw_virtualbmc_sshkey_path }}.pub" - name: Revoke VBMC SSH access ansible.posix.authorized_key: user: "{{ ansible_user_id }}" key: "{{ _vbmc_key.content | b64decode }}" state: absent - name: Remove vbmc files vars: dest_dir: "{{ cifmw_virtualbmc_sshkey_path | dirname }}" ansible.builtin.file: path: "{{ item }}" state: absent loop: - "{{ cifmw_virtualbmc_sshkey_path }}" - "{{ cifmw_virtualbmc_sshkey_path }}.pub" - "{{ dest_dir }}/virtualbmc.conf" - "{{ dest_dir }}/vbmcd.sh"