Tendrl / tendrl-ansible

Ansible playbook for Tendrl!
GNU Lesser General Public License v2.1
1 stars 15 forks source link

update assert tasks to work with ansible 2.7 #125

Closed mbukatov closed 5 years ago

mbukatov commented 5 years ago

This is fixing https://github.com/Tendrl/tendrl-ansible/issues/124 and works both with ansible 2.6 and 2.7.

mbukatov commented 5 years ago

With this fix, the error messages looks like this:

TASK [Abort the playbook if python dns is not installed] *************************************************************************
fatal: [localhost]: FAILED! => {
    "assertion": "python2_c_import_dns.rc == 1", 
    "changed": false, 
    "evaluated_to": false, 
    "msg": "This playbook uses dig lookup module[1], which requires python dns module[2] installed[3] on ansible control machine (the machine where you run this ansible playbook from). [1] https://docs.ansible.com/ansible/latest/playbooks_lookups.html#the-dns-lookup-dig [2] http://www.dnspython.org/ [3] Fedora package: python2-dns, RHEL 7 package: python-dns\n"
}
        to retry, use: --limit @/home/usmqe/prechecks.fixed.retry
mbukatov commented 5 years ago

In a024069b682d2dcd9e2d8a3be01d48bf5c165fc2 I tweaked the longest message a bit, so that now it looks like this:

TASK [Assert fail if firewalld is not installed and running] ******************************************************************************************************************************
Wednesday 10 October 2018  09:05:17 +0200 (0:00:00.775)       0:00:00.826 *****
fatal: [localhost]: FAILED! => {
    "assertion": false, 
    "changed": false, 
    "evaluated_to": false, 
    "msg": "tendrl-ansible did not complete execution as firewalld is not installed, enabled nor running. You can either: 1) Install firewalld and ensure ports are configured for existing services (eg. Gluster). Then rerun this playbook. 2) Set ansible variable 'configure_firewalld_for_tendrl' to False, so that tendrl-ansible does not modify existing firewall configurations when you rerun the playbook.  With this setting, you are responsible for the firewall configuration and ensure all necessary ports are opened (including Gluster and Tendrl ports). For list of ports Tendrl requires to be open, refer to the documentation.\n"
}