Kevin Carter 9912b049e9
Create a podman role
This change creates a role using the podman content from
THT[0]. This role will run through all of the tasks found
within the THT file, and implements molecule tests coving
the functionality.

Test Matrix:
  - default - Runs through the role top to bottom
  - install - Runs only the install portions of the role
  - login - Runs only the login portion of the role

[0] - https://github.com/openstack/tripleo-heat-templates/blob/master/deployment/podman/podman-baremetal-ansible.yaml

Task: 34598
Task: 34600
Task: 34601
Story: 2006017

Change-Id: Ia7fd611320d2f29b330a04484dca3146d74d8d82
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-07-16 11:46:21 -05:00

63 lines
1.7 KiB
YAML

---
# Copyright 2019 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: Check if docker has some data
stat:
path: /var/lib/docker
register: docker_path_stat
- name: Docker purge block
when:
- docker_path_stat.stat.exists | bool
become: true
block:
- name: Check docker service state
systemd:
name: docker
register: docker_service_state
- name: Run docker system prune
shell: docker system prune -a -f
when:
- (docker_service_state.status['SubState'] | lower) == 'running'
- name: Stop and disable Docker service
systemd:
name: docker
state: stopped
enabled: false
- name: Uninstall Docker rpm
package:
name: "{{ tripleo_podman_purge_packages }}"
state: absent
- name: Refresh hardware facts
setup:
gather_subset:
- hardware
- name: Un-mount docker directories
mount:
path: "{{ item.mount }}"
state: unmounted
loop: "{{ ansible_mounts | selectattr('mount', 'search', 'docker') | list }}"
- name: Purge /var/lib/docker
file:
path: /var/lib/docker
state: absent