openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

ansible setup.yml failed with error ''ansible_distribution' is undefined '

Open parichehrvn opened this issue 4 years ago • 4 comments

Hi I want to install Openwhisk with docker using ansible. But when I run ansible-playbook -i environments/local setup.yml I get this error:

The conditional check 'nginx.ssl.cert == "openwhisk-server-cert.pem"' failed. The error was: error while evaluating conditional (nginx.ssl.cert == "openwhisk-server-cert.pem"): 'ansible_distribution' is undefined The error appears to have been in '/home/parichehr/openwhisk/ansible/setup.yml': line 60, column 5, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: # Generate nginx certificates - name: gen untrusted server certificate for host ^ here

parichehrvn avatar Oct 25 '20 14:10 parichehrvn

As noted in slack, I think this is related to your ansible version being 2.5.2. Please try with ansible 2.7.7 or later.

rabbah avatar Oct 26 '20 14:10 rabbah

As noted in slack, I think this is related to your ansible version being 2.5.2. Please try with ansible 2.7.7 or later.

I try with ansible 2.7.7 but I still get the same error. I try to modify setup.yml as follows:

- name: Setup.yml
  hosts: all
  gather_facts: yes

  tasks:
  ...........

and this error is solved but I get this error in TASK [gen untrusted client certificate for host]

non-zero return code
generating client ca key generating client ca request generating client ca
pem generating client key generating client certificate csr file generating
self-signed client certificate
Generating RSA private key, 2048 bit long modulus (2 primes) .....+++++
........+++++ e is 65537 (0x010001) Signature ok subject=C = US, ST = NY, L =
Yorktown, O = OpenWhisk, CN = *.localhost Getting Private key Generating RSA
private key, 2048 bit long modulus (2 primes) ...........................+++++
........+++++ e is 65537 (0x010001) Signature ok subject=C = US, ST = NY, L =
Yorktown, O = OpenWhisk, CN = guest Getting CA Private Key unable to load CA
Private Key 139724263978304:error:0909006C:PEM routines:get_name:no start
line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY

parichehrvn avatar Oct 26 '20 18:10 parichehrvn

I can confirm that I had the same exact issue, and updating the ansible from version 2.5.2 to 2.9.6 fixed the problem for me.

engshahrad avatar Dec 29 '20 21:12 engshahrad

Tried with 2.12.4 and problem fixed.

kingzevin avatar Apr 04 '22 01:04 kingzevin