Closed Sftobias closed 4 months ago
This PR returns error for previous changes in particular the force on the creation on the configuration files. In particular this commit: https://github.com/ai4os/ai4-ansible/commit/99e23093057d1915042d930fffea55e96a2246cf
I understand that they are failing because once the tests have been executed, it is expected that successive executions will not cause changes, right?
Actually the principle of idempotence, as I understand it, is being fulfilled given that the content of the modified files is not changing between these executions, but since the ansible recap says that if there have been changes the tests assume that this principle has not been fulfilled. I'm wrong?
The problem is that some steps change the same file, particularly the client.hcl
in both consul and nomad.
First, it creates the client.hcl
using the template, then it changes it, replacing the consul token, so when you execute the playbook again, as the token has been replaced, the template creates again the client.hcl
and the replace perform again the replacement, so it will always raise errors in idempotency.
But as the role need a first version of the client.hcl
file to generate the tokens it is not easy to solve this issue.
Any ideas?
Could we create the acl token before creating the client.hcl file?
The thing is that we are putting the template with a default token and then recovering the token and replacing it in the template. Why don't we recover the token before loading the configuration file? So ansible if it should be able to detect that the configuration file has not received new changes.
Maybe I'm wrong, but as far as the tokens are received in the zip file that the ifca admin gives to the site admin, right? Why is it necessary to have a first version of the template to be able to recover the tokens? It is a process that until now I have not had to do manually, so I may be saying things that make no sense.
Maybe I'm wrong, but as far as the tokens are received in the zip file that the ifca admin gives to the site admin, right? Why is it necessary to have a first version of the template to be able to recover the tokens? It is a process that until now I have not had to do manually, so I may be saying things that make no sense.
The tokens are received in a zip in case of joining a cluster, but if you are creating a new one, you need to generate them.
Maybe I'm wrong, but as far as the tokens are received in the zip file that the ifca admin gives to the site admin, right? Why is it necessary to have a first version of the template to be able to recover the tokens? It is a process that until now I have not had to do manually, so I may be saying things that make no sense.
The tokens are received in a zip in case of joining a cluster, but if you are creating a new one, you need to generate them.
You are rigth. This issue will require me to further study the token creation process to see if it is possible to do it another way. I am going to create a task for this but at the moment it is not something that is a priority. Is there a way to skip the idempotence test in these cases? Even if it's temporarily until I can get to grips with this matter.
I have a possible solution, I will test it and create a new branch with the fix.
PR: created #26
Now tests seems to be failing due to something related with docker daemon.
Docker error (https://github.com/docker/docker-py/issues/3256) fixed.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Avoid nomad to delete docker images after job stops