'dict object' has no attribute 'stdout'

2,185 views
Skip to first unread message

Alicia Smith

unread,
Apr 27, 2017, 5:12:44 PM4/27/17
to Ansible Project
Hello, I was wondering if I could get some help on determining what is wrong here.

This worked prior to 2.2.x
Now when I run it I get the following error:

fatal: [redacted-host.com]: FAILED! => {"failed": true, "msg": "The conditional check 'auditd_result.stdout.find(\"audit-2.3\") != -1' failed. The error was: error while evaluating conditional (auditd_result.stdout.find(\"audit-2.3\") != -1): 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/Redacted/Path/To/roles/audisp-json/tasks/main.yml': line 29, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install auditd.conf\n  ^ here\n"}

- name: Install auditd.conf
  copy:
    src: roles/audisp-json/files/auditd-2.3.conf
    dest: /etc/audit/auditd.conf
    owner: root
    group: root
    mode: 0640
  when: auditd_result.stdout.find("audit-2.3") != -1
  notify: Restart auditd

- name: Install auditd.conf
  copy:
    src: roles/audisp-json/files/auditd-2.5.conf
    dest: /etc/audit/auditd.conf
    owner: root
    group: root
    mode: 0640
  when: auditd_result.stdout.find('audit-2.5') != -1
  notify: Restart auditd

- name: Install auditd.conf
  copy:
    src: roles/audisp-json/files/auditd-2.6.conf
    dest: /etc/audit/auditd.conf
    owner: root
    group: root
    mode: 0640
  when: auditd_result.stdout.find('audit-2.6') != -1
  notify: Restart auditd

Dick Visser

unread,
Apr 27, 2017, 7:00:12 PM4/27/17
to ansible...@googlegroups.com
The error is caused earlier on, namely in the task where you register auditd_result.
Try debugging that.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9d54d0f5-a19e-4af1-880d-ba8ac4177e90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs
Reply all
Reply to author
Forward
0 new messages