Look Up Configuration Details

Use the ansible_cfg_search to troubleshoot node boots and examine configuration problems.

The ansible_cfg_search command line tool enables an administrator on the SMW to specify a config set, an IMPS image root, and optionally, an Ansible play to query for config set lookups and template locations. The intent is to provide a general understanding of which configuration files are used at specific points in the boot process. The command uses the playbook structure to inspect the plays, roles, templates, and task files for patterns that appear to be config set variable lookups. For each lookup found in the Ansible content, the command lists a path to the configuration template that holds the variable.

Disclaimer: the ansible_cfg_search tool may not find all references.

Before using ansible_cfg_search, load the system-config module.

ansible_cfg_search [-h] [-p PLAYBOOK] [-s CONFIG_SETTING] [-e LOOKUP_EXPRESSION] 
            [-q] config_set image
Required arguments:
config_set
The config set to search for config variables.
image
The IMPS image root containing ansible content to search. If necessary, use the image list command to find the IMPS image root.
Optional arguments:
-h, --help
Display help information.
-p PLAYBOOK, --playbook PLAYBOOK
The Ansible playbook file contained in the IMPS image to search for configuration lookups.
-s CONFIG_SETTING, --config-setting CONFIG_SETTING
List the configuration templates and Ansible files that contain the specified setting.

Example

Examine a config set to determine the settings that the baseopts.yaml play is looking up:
smw: # module load system-config
smw: # ansible_cfg_search p0 \
service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120 \
--play baseopts.yaml
Output:
/var/opt/cray/imps/image_roots/service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120/etc/ansible/baseopts.yaml:
  
  - /var/opt/cray/imps/image_roots/service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120/etc/ansible/roles/baseopts/tasks/smw.yaml:
    - /var/opt/cray/imps/config/sets/p0/config/cray_user_settings_config.yaml:
      - cray_user_settings.settings.default_modules.data.smw
  
  - /var/opt/cray/imps/image_roots/service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120/etc/ansible/roles/baseopts/tasks/main.yaml:
    - /var/opt/cray/imps/config/sets/p0/config/cray_login_config.yaml:
      - cray_login.settings.login_nodes.data.members
    - /var/opt/cray/imps/config/sets/p0/config/cray_user_settings_config.yaml:
      - cray_user_settings.settings.default_modules.data.login
      - cray_user_settings.settings.default_modules.data.service
      - cray_user_settings.settings.default_modules.data.smw
  
  - /var/opt/cray/imps/image_roots/service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120/etc/ansible/roles/baseopts/tasks/login.yaml:
    - /var/opt/cray/imps/config/sets/p0/config/cray_user_settings_config.yaml:
      - cray_user_settings.settings.default_modules.data.login
  
  - /var/opt/cray/imps/image_roots/service_cle_6.0.UP03-build6.0.3074_sles_12-created20170120/etc/ansible/roles/baseopts/tasks/service.yaml:
    - /var/opt/cray/imps/config/sets/p0/config/cray_user_settings_config.yaml:
      - cray_user_settings.default_modules
      - cray_user_settings.default_modules.login
      - cray_user_settings.default_modules.service
      - cray_user_settings.default_modules.smw
      - cray_user_settings.settings.default_modules.data.service