-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call to 'certificates_to_synchronize' causes openshift_master_certificates to abend with 'ERROR! |failed expects hostvars is a dict' #7596
Comments
Found that the error is coming from: /etc/ansible/playbooks/openshift-ansible/roles/lib_utils/filter_plugins/openshift_master.py line 487. hostvars[inventory_hostname] is being passed in to the custom filter certificates_to_synchronize I did a little googling and found that the type for hostvars[inventory_hostname] is returned as a class instead of a dict. I'm not a python scripter so this is taking longer than I hoped to work through anyone with an idea here on what to do? debug code via altering line 487:
|
OK. I think I understand what's happening and how I got around the problem, though, I'm at least a week away from knowing enough python to prove/disprove anything. In /etc/ansible/playbooks/openshift-ansible/roles/openshift_master_certificates/tasks/main.yml around line 63 I simply changed the with_items clause from I think since the hostvars[inventory] is magic it doesn't exist as a dictionary until accessed. So, accessing a dictionary variable ansible_facts solves 2 problems of instantiating the variable and passing an actual dictionary to the customer filter. Don't know how to raise this as a bug (possible), but if someone in the know ever reads this please let me know if I guessed right as to why the work-a-round worked and how to place this as a bug report. |
@AllanCano, thanks for the detective work. I got the same error in For the sake of completeness, here's my openshift version settings:
And running ansible 2.6.0. |
Just FYI After fixing this issue manually I continued and ran into #4985, where it was suggested to work under ansible 2.4.2, so I downgraded. After downgrading the above fix did not work, so I had to un-do it to continue installation under ansible 2.4.2. |
Ensure that the openshift_master.py filter plugin handles ansible 2.4 and 2.5 hostvars gracefully. This is required due to the changes introduced in ansible via changes in ansible/ansible#35913. Resolves: openshift#7596
Ensure that the openshift_master.py filter plugin handles ansible 2.4 and 2.5 hostvars gracefully. This is required due to the changes introduced in ansible via changes in ansible/ansible#35913. Resolves: openshift#7596
Ensure that the openshift_master.py filter plugin handles ansible 2.4 and 2.5 hostvars gracefully. This is required due to the changes introduced in ansible via changes in ansible/ansible#35913. Resolves: openshift#7596
This fix works for me for deploy_cluster but not for This will again fail with this message. To successfully run redeploy this fix needs to be reversed I think. So two separate 3.9 branches are necessary to successful run 3.9 branch. This looks like a mess. |
@AllanCano Not sure if anyone confirmed this, but your resolution of modifying /etc/ansible/playbooks/openshift-ansible/roles/openshift_master_certificates/tasks/main.yml has fixed our issue. This was line 95 for us. |
Hi @ALL, I have the same issue with deploying openshift, but after apply this patch above everythink work fine. Greatings,
|
I am also facing the same error while installing openshift 3.9.0. What is the actual fix that needs to be made to fix this issue 'ERROR! |failed expects hostvars ' |
Things have been going no where for me for days :( |
I am also facing the same error while installing openshift 3.9.0. |
My error is: ok: [master.rafaeltomelin.co -> master.rafaeltomelin.co] => { TASK [openshift_master_certificates : Create the master server certificate] ********************************************************************************* TASK [openshift_master_certificates : Generate the loopback master client config] *************************************************************************** |
I change line 95 in openshift-ansible/roles/openshift_master_certificates/tasks/main.yml and success: Line 95: certificates_to_synchronize is a custom filter in lib_utils#- "{{ hostvars[inventory_hostname] | certificates_to_synchronize }}"
|
For release-3.9 and Ansible 2.6.0.0 this solved it for me: abn@b20684b |
Thanks @plaimbock! Using the patch branch got passed the error! But did you happen to hit an error on task
wherein the Manually running said command yields the below output (note that the hostname
|
By changing the below lines it solved for me
|
So no modifications are required for ansible 2.4, right? This seems to be caused by ansible 2.6 changes |
You ask a very good question, @vrutkovs. The readme indicates that 2.5.x is out of the question, and that anything lower than 2.4.3.0 won't work either. Here's what I have available in Centos7's yum packages:
I have a feeling 2.3.0.0 wouldn't work since it's technically lower than 2.4.3.0. I'm testing with immutable infrastructure and would be happy to test out other version of Ansible. What's an ideal way to get |
2.4.2 would work, although its known to leak memory. Not sure why would CentOS not update to 2.4.3 - but that's a bug in CentOS anyway. |
I'm running from the EPEL package on CentOS. I have version 2.5.5 installed. No building of packages required. |
BTW, I tested the patch. It worked for me. |
@lbrigman124 Funny thing is that I had installed openshift on centos 7 last thursday and it went fine, when I tried to install on other machine ( same OS ) at saturday, the issue came out :). |
@damiandragowski I had the exact same experience. I have been using a fixed commit(c264b57) since about the middle of April without any issues including multiple changes in the version of Ansible. Friday of last week(July 6), I started seeing the above failure. Something else in the environment changed to trigger this failure. |
For release-3.9 and Ansible 2.6.0.0 this solved it for me: abn/openshift-ansible@b20684b Will one merge it? |
Ensure that the openshift_master.py filter plugin handles ansible 2.4 and 2.5 hostvars gracefully. This is required due to the changes introduced in ansible via changes in ansible/ansible#35913. Resolves: openshift#7596
Ensure that the openshift_master.py filter plugin handles ansible 2.4 and 2.5 hostvars gracefully. This is required due to the changes introduced in ansible via changes in ansible/ansible#35913. Resolves: openshift#7596
The openshift/origin-ansible container v3.9 has the same issue (3.9.33) |
By changing the below lines it solved for me "{{ hostvars[inventory_hostname] | certificates_to_synchronize }}" |
This is https://bugzilla.redhat.com/show_bug.cgi?id=1605046 |
I have something similar issue while redeploying master certificates and ended up with errors below: ASK [Remove generated certificates] ************************************************************************************************************************** MSG: Unexpected templating type error occurred on ({{ hostvars[inventory_hostname] | certificates_to_synchronize(include_keys=false, include_ca=false) }}): certificates_to_synchronize() got an unexpected keyword argument 'include_ca' openshift-ansible version : openshift-ansible-3.4.90-1 |
Description
Provide a brief description of your issue here. For example:
On a multi master install deploy_cluster.yml terminates after task
"openshift_master_certificates : Generate the loopback master client config"
with the error message
"ERROR! |failed expects hostvars is a dict"
Version
Inventory Hosts Files
Steps To Reproduce
File: /etc/sysconfig/docker-storage-setup
We need at least Ansible 2.4.3. At the time of writing this doc the latest published was 2.4.2. So, we need to role our own RPM. To build Ansible we need:
File contents listed above.
I updated the allowed docker versions for (3,7) to include 1.13 and 1.13.1
Expected Results
Describe what you expected to happen.
Observed Results
Everything is chugging along find. The verbose output before the abend is listed below. I don't see any other errors in the output until this.
The text was updated successfully, but these errors were encountered: