Role - tripleo-module-load

Role Documentation

Welcome to the “tripleo-module-load” role documentation.

Role Defaults

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

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

# Load specific kernel modules using a list of hashes. This variable also
# takes the keyword "params" and "state". Params is assumed to be `null` and
# state is assumed to be "present"; tate can be either "present" or "absent".
#
# modules:
#   - name: foo
#     params: 'bar baz'
#   - name: starwars
#   - name: starwars
#     state: absent
#
# 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.
tripleo_modules: '{{ modules | default([]) }}'

Molecule Scenarios

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

Scenario: legacy_vars

Driver: delegated
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
  hosts: all
  roles:
  - role: tripleo-module-load
    modules:
    - name: dummy

Scenario: default

Driver: delegated
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
  hosts: all
  roles:
  - role: tripleo-module-load
    tripleo_modules:
    - name: dummy

Scenario: remove_module

Driver: delegated
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 remove_module playbook
- name: Converge
  hosts: all
  roles:
  - role: tripleo-module-load
    tripleo_modules:
    - name: dummy
  - role: tripleo-module-load
    tripleo_modules:
    - name: dummy
      state: absent