Comments (12)
$(hostname --fqdn)
can be replaced by $(hostname -f)
. Here's the new error:
dnsdomainname: command not found
from ansible-pki.
I don't have access to a MacOS X system to test. I have asked specifically for MacOS X testers before merging the role, on IRC and on GitHub.
Does the script work if you change the shebang to #!/usr/bin/env bash
? What does your $PATH
look like, is /usr/local/bin
listed before /bin
(as it should be)?
Does hostname -f
return the full FQDN (at least 1 dot), or just a hostname?
What do you get when you run type dnsdomainname
in the terminal? I suppose that I can use an alternative method of getting the domain if this command is not available.
from ansible-pki.
hostname -f
returns Carls-MacBook-Air-2.local
. So there's the dot. I suggested it because according to the man page on Linux -f
and --fqdn
are the same.
dnsdomainname
doesn't exist. I'm not sure what command to use for that one.
The other issue that I just looked at is that openssl
is out-of-date. So that's something to keep in mind as well for Mac OS X users. Also there was some notes when I installed it, I'll copy them here in case they're useful:
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
from ansible-pki.
I will take care of the dnsdomainname
by parsing hostname -f
, I hope that MacOS X handles Bash variable substitution, you never know...
How out of date that OpenSSL is? Can it be updated? I suppose that if you provide me with functions that handle certificate request generation, key generation, signing, etc., they could be added to the script. That's how it supports both OpenSSL and GnuTLS right now, so one more shouldn't hurt.
Although, as with GnuTLS right now, I'm not sure how extensive Apple-TLS-based CA would be. From my experiments, GnuTLS CA is pretty limited, that's why I chose OpenSSL as a default CA.
Did the new shebang do the trick?
from ansible-pki.
Yes! sorry forgot about that. The she bangs seems to have worked.
from ansible-pki.
OK then, I'm working on updates to the role.
from ansible-pki.
@carlalexander The #43 pull request should fix some issues on MacOSX.
from ansible-pki.
Thanks will test it out soon. I'm flying tomorrow so weekend more likely.
from ansible-pki.
I just tried it with your changes from #43. Works fine now!
from ansible-pki.
I would vote for reopening this, since some issues still prevent this role from working on OS X:
TASK [debops.pki : Sign certificate requests for current hosts] ****************
fatal: [ec2-1-2-3-4.eu-central-1.compute.amazonaws.com -> localhost]: FAILED! => {"changed": false, "cmd": ["./lib/pki-authority", "sign-by-host", "ec2-1-2-3-4", "ip-172-31-49-63.eu-central-1.compute.internal"], "delta": "0:00:00.015779", "end": "2016-09-02 23:08:54.622601", "failed": true, "rc": 2, "start": "2016-09-02 23:08:54.606822", "stderr": "./lib/pki-authority: line 82: declare: -g: invalid option\ndeclare: usage: declare [-afFirtx] [-p] [name[=value] ...]", "stdout": "", "stdout_lines": [], "warnings": []}
from ansible-pki.
@antoineco This is due to an old bash
version on MacOS X. I suppose that the pki-authority
and perhaps pki-realm
scripts would need to be rewritten in Python to fix that permanently. I wrote them in Bash initially because most things they do is move/link files around and run openssl
and certtool
commands. In Python, I would probably use the respective libraries instead, but I didn't have the drive to learn that at the time. At that moment I was also doing the complete role redesign, and Bash for me seemed a good idea for a first implementation.
Alternatively, you could update your Bash to 4.x version, that should work fine.
from ansible-pki.
@drybjed you're right, I though the -g
flag was the issue but actually associative arrays are also a feature added in bash 4.2.
On OS X a simple brew install bash
will install GNU bash, version 4.3.46(1)-release (x86_64-apple-darwin15.5.0)
and your script will use it automatically. Thanks for your answer!
from ansible-pki.
Related Issues (20)
- Role breaks without warning (and continues on "normally") if SAN misconfigured HOT 9
- Fail: No module named debops HOT 12
- [Security] debops.pki does not validate CSRs allowing certificate mis-issuance by compromised remote host
- tiny-acme suddenly causes errors HOT 20
- First PKI run fails to create ACME certificates HOT 4
- Changing config parameters has not effect HOT 2
- Changing pki_acme_ca does not reload the nginx server
- Improve docs visibility of `name_constraints` variable
- Remove the pain points when managing ACME certificates HOT 12
- Replaced external certificates are not copied to host HOT 1
- Failure on task: Sign certificate requests for current hosts HOT 3
- ./lib/pki-authority: line 164: declare: -g: invalid option error HOT 3
- debops.pki fails when 1 of the hosts is unreachable HOT 1
- Errors during creation of new LetsEncrypt account via acme. HOT 6
- Error every second pki run HOT 9
- KeyError: 'newAccount' when attempting to generate ACME certificate HOT 5
- Role debops.pki/env fails to resolve after Ansible 2.4 HOT 10
- No wildcard/domain in the 'domain' realm certificates HOT 2
- pki role generates invalid certificate with "permitted subtree violation"
- ing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-pki.