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

./lib/pki-authority: line 164: declare: -g: invalid option error #122

Closed nodje closed 6 years ago

nodje commented 6 years ago

This happens with ansible 2.4.0.1 and latest debops on a fresh Debian Stretch machine.

TASK [debops.pki : Initialize PKI authorities] ******************************************************************************************************************
failed: [server -> localhost] (item={u'subdomain': u'root-ca', u'name': u'root', u'key_size': u'4096', u'subject': [u'o=MyDomain Certificate Authority']}) => {"changed": true, "cmd": ["./lib/pki-authority", "init", "--name", "root", "--default-sign-base", "365", "--root-sign-multiplier", "12", "--ca-sign-multiplier", "10", "--cert-sign-multiplier", "3"], "delta": "0:00:00.021152", "end": "2017-11-17 19:00:21.720638", "failed": true, "item": {"key_size": "4096", "name": "root", "subdomain": "root-ca", "subject": ["o=MyDomain Certificate Authority"]}, "msg": "non-zero return code", "rc": 2, "start": "2017-11-17 19:00:21.699486", "stderr": "./lib/pki-authority: line 164: declare: -g: invalid option\ndeclare: usage: declare [-afFirtx] [-p] [name[=value] ...]", "stderr_lines": ["./lib/pki-authority: line 164: declare: -g: invalid option", "declare: usage: declare [-afFirtx] [-p] [name[=value] ...]"], "stdout": "", "stdout_lines": []}
failed: [server -> localhost] (item={u'key_size': u'4096', u'subject': [u'o=MyDomain', u'ou=Domain CA'], u'subdomain': u'domain-ca', u'issuer_name': u'root', u'name': u'domain'}) => {"changed": true, "cmd": ["./lib/pki-authority", "init", "--name", "domain", "--default-sign-base", "365", "--root-sign-multiplier", "12", "--ca-sign-multiplier", "10", "--cert-sign-multiplier", "3"], "delta": "0:00:00.014699", "end": "2017-11-17 19:00:21.955539", "failed": true, "item": {"issuer_name": "root", "key_size": "4096", "name": "domain", "subdomain": "domain-ca", "subject": ["o=MyDomain", "ou=Domain CA"]}, "msg": "non-zero return code", "rc": 2, "start": "2017-11-17 19:00:21.940840", "stderr": "./lib/pki-authority: line 164: declare: -g: invalid option\ndeclare: usage: declare [-afFirtx] [-p] [name[=value] ...]", "stderr_lines": ["./lib/pki-authority: line 164: declare: -g: invalid option", "declare: usage: declare [-afFirtx] [-p] [name[=value] ...]"], "stdout": "", "stdout_lines": []}
drybjed commented 6 years ago

Are you using MacOS X as your Ansible Controller? The debops.pki requires bash 4.x on the Controller side to work correctly, sorry. You might need to update your bash version.

nodje commented 6 years ago

I'm using zsh, so not compatible, and it seems bash on macOS 10.12 &10.13 is still 3.2.57. brew got me 4.4.12 but I messed up python on the way, it find ansible packages anymore...

Anyways, I got it running fine on an Archlinux instance anyway, so not an issue.

The bash 4.4.x requirement should be written somewhere though. I understand the simplicity for you to let people use a VM, but it seems a bit too much for me to setup a VM just for an ansible controller... Closing the issue.

drybjed commented 6 years ago

You can now set up a VM using Vagrant or a Docker container that can act as an Ansible Controller. Instructions are in the README.rst in the monorepo.