debops / ansible-pki

Bootstrap and manage internal PKI, Certificate Authorities and OpenSSL/GnuTLS certificates
GNU General Public License v3.0
65 stars 29 forks source link

debops.pki fails when 1 of the hosts is unreachable #123

Open whohoho opened 6 years ago

whohoho commented 6 years ago

TASK [debops.pki : Sign certificate requests for current hosts] **** fatal: [node1.domain]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'pki_fact_fqdn'\n\nThe error appears to have been in virt-ansible/roles/external/debops.pki/tasks/main.yml': line 350, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# Sign certificate requests [[[\n- name: Sign certificate requests for current hosts\n ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no attribute 'pki_fact_fqdn'"}

line 349 of tasks/main.yml:

command: ./lib/pki-authority sign-by-host {% for host in play_hosts %}{{ hostvars[host].pki_fact_fqdn }} {% endfor %}

drybjed commented 6 years ago

Thanks for the heads up, Jinja loop should skip hosts without the facts set. I'll try and update the role when I have some time.