Skip to main content

Overview of Dynamic Playbooks

Overview of Dynamic Playbooks

Dynamic Playbooks refer to playbooks that are designed to handle various configurations and tasks dynamically based on the variables and conditions defined within them. They leverage Ansible's templating and conditional capabilities to execute tasks that can change based on the input parameters or the state of the system.

Dynamic Playbooks in playbooks/dynamic_mktun.yml

The playbook playbooks/dynamic_mktun.yml demonstrates the use of dynamic playbooks to create, activate, export, import, and remove IPv4 tunnels based on the variables provided. It uses the ibm.power_aix.mktun module to manage these tunnels dynamically.


This snippet from playbooks/dynamic_mktun.yml shows how to create and activate a manual IPv4 tunnel using the ibm.power_aix.mktun module.

---
- name: Demo for mktun module
hosts: all
gather_facts: true
vars:
log_file: /tmp/ansible_mktun_debug.log
ip_v4_address_src: 10.10.11.72
ip_v4_address_dest: 10.10.11.98
var_ah_algo: HMAC_MD5
var_esp_algo: DES_CBC_8
var_esp_spi: 12345
var_id_1: 3
var_id_2: 4
var_id_3: 5

tasks:
- name: Create and activate a manual IPv4 tunnel
ibm.power_aix.mktun:
manual:
ipv4:
- src:

Dynamic Playbooks in playbooks/dynamic_tunables.yml

The playbook playbooks/dynamic_tunables.yml demonstrates the use of dynamic playbooks to display, modify, and reset tunable parameters for AIX systems. It uses the ibm.power_aix.tunables module to manage these parameters dynamically.


This snippet from playbooks/dynamic_tunables.yml shows how to display VM tunable parameters using the ibm.power_aix.tunables module.

---
- name: "Display vm tunables parameters"
hosts: all
gather_facts: false
vars:
component_name: "vmo"
var_tunable_params: ["vm_mmap_bmap", "vmm_default_pspa"]
var_tunable_params_dict: {"lgpg_regions": 10, "lgpg_size": 16777216}
var_change_type: "reboot"
bool_restricted_tunables: true
bool_bosboot_tunables: true
log_file: "/tmp/ansible_tunables_debug.log"

tasks:
- name: "Show all tunable parameters excluding restricted parameters"
ibm.power_aix.tunables:
action: show
component: "{{ component_name }}"
register: tunables_result

- name: "Debug: tunables_result"

Dynamic Playbooks in playbooks/dynamic_tunfile_mgmt.yml

The playbooks/dynamic_tunfile_mgmt.yml playbook showcases how to manage tunable files dynamically, including saving, validating, modifying, and restoring tunable files. It uses the ibm.power_aix.tunfile_mgmt module for these operations.


This snippet from playbooks/dynamic_tunfile_mgmt.yml shows how to save all tunables to a file using the ibm.power_aix.tunfile_mgmt module.

---
- name: Tunfile manager for AIX
hosts: all
gather_facts: false
vars:
var_set_default: true
var_filename: "/tunfile_mgmt_test"
component_name: "schedo"
bool_save_all_tunables: false
var_validation_type: "reboot"
var_tunables_with_values: {"nfso": {"client_delegation": 1, "nfs_rfc1323": 1}}
bool_make_nextboot: true
log_file: "/tmp/ansible_tunfile_debug.log"

tasks:
- name: "Save all tunables to a file"
ibm.power_aix.tunfile_mgmt:
action: save
filename: "{{ var_filename }}"
register: tunfile_result
- ansible.builtin.debug:

Dynamic Playbooks in playbooks/dynamic_mpio.yml

In the playbooks/dynamic_mpio.yml playbook, dynamic playbooks are used to gather and print MPIO (Multipath I/O) related information for specific devices. It uses the ibm.power_aix.mpio module to collect this information.


This snippet from playbooks/dynamic_mpio.yml shows how to gather and print MPIO related information using the ibm.power_aix.mpio module.

---
- name: Print the mpio related information
hosts: all
gather_facts: true
vars:
device: IBMSVC
absent_device: ansibleNegativeTest
log_file: /tmp/ansible_mpio_debug.log

tasks:
- name: Gather the mpio info
ibm.power_aix.mpio:

- name: Gather specific device mpio info
ibm.power_aix.mpio:
device: "{{ device }}"

- name: Gather specific absent device mpio info
ibm.power_aix.mpio:
device: "{{ absent_device }}"

Main Functions

There are several main functions in this folder. Some of them are creating, activating, exporting, importing, and removing IPv4 tunnels, displaying, modifying, resetting tunable parameters, managing tunable files, and gathering and printing MPIO related information. We will dive a little into each of these functions.

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human