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 place 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.
- Driver: delegated
- Driver: delegated
- Driver: delegated
Scenario: legacy_vars¶
Molecule Options¶
managed: false
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}
ansible_connection_options:
ansible_connection: ssh
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: docker
containers_to_rm:
- docker-legacy-container1
- docker-legacy-container2
Scenario: default¶
Molecule Options¶
managed: false
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}
ansible_connection_options:
ansible_connection: ssh
Molecule Inventory¶
hosts:
all:
hosts:
instance:
ansible_host: localhost
Example default playbook¶
- name: Converge
become: true
hosts: all
roles:
- role: tripleo-container-rm
tripleo_containers_to_rm:
- docker-container1
- docker-container2
tripleo_container_cli: docker
Scenario: podman-rm-stopped¶
Molecule Options¶
managed: false
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}
ansible_connection_options:
ansible_connection: ssh
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: docker
tripleo_containers_to_rm:
- docker-container1
- docker-container2