debops-tools
debops-tools copied to clipboard
Please enlighten me how to workaround this particular failure I noted
First time using debops.
I ran debops against a target machine 10.0.1.22 in local network and noted this failure. Can you please enlighten me?
failed: [10.0.1.22 -> localhost] (item={u'subdomain': u'root-ca', u'subject': [u'o=Chromebox Certificate Authority'], u'name': u'root', u'key_size': u'4096'}) => {"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.020428", "end": "2016-10-26 17:17:10.360078", "failed": true, "item": {"key_size": "4096", "name": "root", "subdomain": "root-ca", "subject": ["o=Chromebox Certificate Authority"]}, "rc": 2, "start": "2016-10-26 17:17:10.339650", "stderr": "./lib/pki-authority: line 111: declare: -g: invalid option\ndeclare: usage: declare [-afFirtx] [-p] [name[=value] ...]", "stdout": "", "stdout_lines": [], "warnings": []}
failed: [10.0.1.22 -> localhost] (item={u'name': u'domain', u'key_size': u'4096', u'subdomain': u'domain-ca', u'issuer_name': u'root', u'subject': [u'o=Chromebox', u'ou=Domain CA']}) => {"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.009126", "end": "2016-10-26 17:17:10.529653", "failed": true, "item": {"issuer_name": "root", "key_size": "4096", "name": "domain", "subdomain": "domain-ca", "subject": ["o=Chromebox", "ou=Domain CA"]}, "rc": 2, "start": "2016-10-26 17:17:10.520527", "stderr": "./lib/pki-authority: line 111: declare: -g: invalid option\ndeclare: usage: declare [-afFirtx] [-p] [name[=value] ...]", "stdout": "", "stdout_lines": [], "warnings": []}
Seems linked to this https://github.com/debops/ansible-pki/blob/8a7fdebe4104d6249c065fb15a7bf36933fd3d8e/files/secret/pki/lib/pki-authority#L111
./lib/pki-authority: line 111:
declare: -g: invalid option
declare: usage:
declare [-afFirtx] [-p] [name[=value] ...]
My 10.0.1.22 is Ubuntu 16.04 not pure debian.
Strange.
ssh 10.0.1.22
root@chromebox:~# declare -gA config
root@chromebox:~#
Here is the play recap:
PLAY RECAP *********************************************************************
10.0.1.22 : ok=50 changed=0 unreachable=0 failed=1
TASK: debops.core : Create root directories ----------------------------- 2.62s
TASK: debops.apt_preferences : Remove legacy APT preferences ------------ 1.72s
TASK: debops.secret : Create secret directories on Ansible Controller --- 1.70s
TASK: debops.core : Save local facts ------------------------------------ 1.46s
TASK: debops.core : Install local fact scripts -------------------------- 1.05s
TASK: setup ------------------------------------------------------------- 0.89s
TASK: debops.apt_preferences : Remove APT preferences ------------------- 0.85s
TASK: setup ------------------------------------------------------------- 0.79s
TASK: debops.core : Install required core packages ---------------------- 0.67s
TASK: debops.dhparam : Install encryption software ---------------------- 0.63s
On Ansible Controller, you need at least bash 4.x for the debops.pki role to work correctly.
@drybjed Would it make sense to include a check for the Bash version also on the Ansible controller so that this becomes a little bit easier to debug?
@ypid I thought about the same thing. Perhaps the pki-authority script could check the bash version and exit early with an error message that explains what the issue is.
Sounds good.
I am using
zsh --version
zsh 5.2 (x86_64-apple-darwin15.0.0)
@lvnilesh This doesn't really matter in the context of a script interpreter, which woul be /bin/bash. Check your Bash version, mine is:
$ bash --version
GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)
bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.