devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

Get error when run with dry-run #47

Closed ozbillwang closed 7 years ago

ozbillwang commented 8 years ago

Run fine with this role, but got error when run with dry-run (--check)

TASK [haproxy : Add epel repo] *************************************************
fatal: [10_61_136_24]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_pkg_mgr == 'yum' and epel_repo_check.rc != 0' failed. The error was: error while evaluating conditional (ansible_pkg_mgr == 'yum' and epel_repo_check.rc != 0): 'dict object' has no attribute 'rc'\n\nThe error appears to have been in '/Users/bill/telstra/projects/MC/ansible-orchestration/roles.galaxy/haproxy/tasks/install.yml': line 34, 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: 'Add epel repo'\n  ^ here\n"}

msg: The conditional check 'ansible_pkg_mgr == 'yum' and epel_repo_check.rc != 0' failed. The error was: error while evaluating conditional (ansible_pkg_mgr == 'yum' and epel_repo_check.rc != 0): 'dict object' has no attribute 'rc'

The error appears to have been in '/Users/bill/telstra/projects/MC/ansible-orchestration/roles.galaxy/haproxy/tasks/install.yml': line 34, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: 'Add epel repo'
  ^ here

    to retry, use: --limit @front_end_lb.retry

PLAY RECAP *********************************************************************
ozbillwang commented 8 years ago

And in ansible v2.0+, ansible support package module, which is Generic OS package manager.

http://docs.ansible.com/ansible/package_module.html