Role - tripleo-container-rm

Role Documentation

Welcome to the “tripleo_container_rm” role documentation.

Role Defaults

This section highlights all of the defaults and variables set within the “tripleo_container_rm” role.

# All variables intended for modification should be placed in this file.

# NOTE(cloudnull): This role used to use a non-namespaced option, which has a high
#                  probability of creating conflicts with other roles in the greater
#                  ansible ecosystem. To ensure that we're able to retain existing
#                  variable functionality the "modules" option will supersede
#                  "tripleo_modules" if defined. This default should be removed
#                  just as soon as we're validate that the non-namespaced option
#                  is no longer in use.
#
# Set the container command line entry-point
tripleo_container_cli: "{{ container_cli | default('podman') }}"

# List of containers to delete
tripleo_containers_to_rm: '{{ containers_to_rm | default([]) }}'

Molecule Scenarios

Molecule is being used to test the “tripleo_container_rm” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example default playbook
- name: Converge
  become: true
  hosts: all
  roles:
  - role: tripleo_container_rm
    tripleo_container_cli: podman
    tripleo_containers_to_rm:
    - podman-container1
    - podman-container2

Scenario: podman-rm-stopped

Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example podman-rm-stopped playbook
- name: Converge
  become: true
  hosts: all
  roles:
  - role: tripleo_container_rm
    tripleo_container_cli: podman
    tripleo_containers_to_rm:
    - podman-container1
    - podman-container2

Scenario: legacy_vars

Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example legacy_vars playbook
- name: Converge
  become: true
  hosts: all
  roles:
  - role: tripleo_container_rm
    container_cli: podman
    containers_to_rm:
    - podman-legacy-container1
    - podman-legacy-container2