#Looking for help getting a debug message.

1 messages · Page 1 of 1 (latest)

hearty dagger
#

Hi all, just trying to get a simple debug message as a first step to get it to write a simple text file, but I think I'm missing something. Right now, it shows the debug message with no information. My playbook is posted below. ---

  • hosts: localhost
      gather_facts: true
      vars:
        input: &input
          hostname: '10.16.166.11'
          username: 'admin'
          password: 'Netapp123'
          https: true
          validate_certs: false
      tasks:
        - name: run ontap cli command
          netapp.ontap.na_ontap_command:
            hostname: "10.16.166.11"
            username: "admin"
            password: "Netapp123"
            command: ['version']
            return_dict: true
          register: cluster_version     - debug:
            msg: "Version ['msg']['stdout']"
haughty stratus
#

variable registered is cluster_verion

- debug: var=cluster_version['msg']['stdout'] should work.

knotty matrix
#

or another example:

debug:
  msg: "{{ cluster_version }}"```
hearty dagger
#

I do have another question, Is there a way to get this sent to an output file? Looking to basically have a bunch of checks done and then have the results sent to an output file so that we can look at it. The first part was to actually get the debug message we wanted. The play so far is.     - name: Write output to file
      copy:
        content: "{{ cluster_version | map(attribute='stdout') | join('\n\n') }}"
        dest: "/tmp/version_show.txt"

#

I get the error below