Skip to content
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

[ansible/artifactory] artifactory role is still not idempotent #116

Closed
weakcamel opened this issue May 14, 2021 · 1 comment · Fixed by #124
Closed

[ansible/artifactory] artifactory role is still not idempotent #116

weakcamel opened this issue May 14, 2021 · 1 comment · Fixed by #124

Comments

@weakcamel
Copy link

Is this a request for help?:

Bug report.

This is continuation of #75 which was only partially fixed.

See #75 (comment)

One more observation - which was probably already spotted during internal testing, but just in case: there is an idempotence issue with generating system.yaml file as well. Namely, there are 3 situations when it's being updated:

  1. by this Ansible role when generating it for the 1st time
  2. by installService.sh script ran from this Ansible role (probably one time only as well, but I'm not sure if that's so) - adding the user.shared
  3. by Artifactory itself when it's encrypting the DB key

This means that re-running Ansible overwrites changes done by (2) and (3).


Which installer:

Ansible

Which product and version:

Artifactory 7.18.5

What happened:

Running the playbook twice against an existing host restarts artifactory despite no changes.

On second run of the playbook the following happens:

TASK [jfrog.platform.artifactory : Configure systemyaml] ************************************************************************************************************
changed: [artifacts.host]
 
TASK [jfrog.platform.artifactory : Configure join key] **************************************************************************************************************
changed: [artifacts.host]
 
TASK [jfrog.platform.artifactory : Create artifactory service] ******************************************************************************************************
changed: [artifacts.host]
 
RUNNING HANDLER [jfrog.platform.artifactory : restart artifactory] **************************************************************************************************
changed: [artifacts.host]

What you expected to happen:

Idempotency is a crucial rule in Ansible.

I'd expect this playbook to to idempotent, i.e. not take any actions if it's not making any actual changes. Especially an action as intrusive like service restart.

How to reproduce it (as minimally and precisely as possible):

https://github.com/jfrog/JFrog-Cloud-Installers/blob/master/Ansible/examples/playbook-rt.yml

Run it twice:

ansible-playbook -i inventory.yml playbook-rt.yml

Anything else we need to know:

n/a

@weakcamel
Copy link
Author

I can confirm that as of 7.19.8, the Artifactory role (as well as nginx) are now idempotent.

Many thanks for the fixes, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants