Role - tripleo-docker-rm

Danger

This role is a linked role to tripleo-container-rm. This role and exists to ensure we’re providing a stable interface as we transition. In a future release this link will be removed in favor of using the stable role, tripleo-container-rm.

Role Documentation

Welcome to the “tripleo-docker-rm” role documentation.

Role Defaults

This section highlights all of the defaults and variables set within the “tripleo-docker-rm” role.

tripleo_container_cli: '{{ container_cli | default(''docker'') }}'
tripleo_containers_to_rm: '{{ containers_to_rm | default([]) }}'

Molecule Scenarios

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

Scenario: docker_rm

Driver: delegated
Molecule Options
ansible_connection_options:
  ansible_connection: ssh
login_cmd_template: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  -o Compression=no -o TCPKeepAlive=yes -o VerifyHostKeyDNS=no -o ForwardX11=no -o
  ForwardAgent=no {instance}
managed: false
Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example docker_rm playbook
- become: true
  hosts: all
  name: Converge
  roles:
  - container_cli: docker
    containers_to_rm:
    - docker-container1
    - docker-container2
    role: tripleo-docker-rm
  vars:
    ansible_python_interpreter: '{{ ansible_user_dir }}/test-python/bin/python'

Scenario: legacy_vars

Driver: delegated
Molecule Options
ansible_connection_options:
  ansible_connection: ssh
login_cmd_template: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  -o Compression=no -o TCPKeepAlive=yes -o VerifyHostKeyDNS=no -o ForwardX11=no -o
  ForwardAgent=no {instance}
managed: false
Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example legacy_vars playbook
- become: true
  hosts: all
  name: Converge
  roles:
  - container_cli: podman
    containers_to_rm:
    - podman-legacy-container1
    - podman-legacy-container2
    role: tripleo-container-rm

Scenario: podman-rm-stopped

Driver: delegated
Molecule Options
ansible_connection_options:
  ansible_connection: ssh
login_cmd_template: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  -o Compression=no -o TCPKeepAlive=yes -o VerifyHostKeyDNS=no -o ForwardX11=no -o
  ForwardAgent=no {instance}
managed: false
Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example podman-rm-stopped playbook
- become: true
  hosts: all
  name: Converge
  roles:
  - role: tripleo-container-rm
    tripleo_container_cli: podman
    tripleo_containers_to_rm:
    - podman-container1
    - podman-container2

Scenario: podman

Driver: delegated
Molecule Options
ansible_connection_options:
  ansible_connection: ssh
login_cmd_template: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  -o Compression=no -o TCPKeepAlive=yes -o VerifyHostKeyDNS=no -o ForwardX11=no -o
  ForwardAgent=no {instance}
managed: false
Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example podman playbook
- become: true
  hosts: all
  name: Converge
  roles:
  - role: tripleo-container-rm
    tripleo_container_cli: podman
    tripleo_containers_to_rm:
    - podman-container1
    - podman-container2

Scenario: default

Driver: delegated
Molecule Options
ansible_connection_options:
  ansible_connection: ssh
login_cmd_template: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  -o Compression=no -o TCPKeepAlive=yes -o VerifyHostKeyDNS=no -o ForwardX11=no -o
  ForwardAgent=no {instance}
managed: false
Molecule Inventory
hosts:
  all:
    hosts:
      instance:
        ansible_host: localhost
Example default playbook
- become: true
  hosts: all
  name: Converge
  roles:
  - role: tripleo-container-rm
    tripleo_container_cli: docker
    tripleo_containers_to_rm:
    - docker-container1
    - docker-container2
  vars:
    ansible_python_interpreter: '{{ ansible_user_dir }}/test-python/bin/python'