0

I use a role for the deployment of java applications and this role is used by two projects. in the role files I store the configuration files of the applications. to avoid each time to modify the role in question when changing the parameters in the configuration file I want to externalize the files outside the role and to have access to the configuration file during the execution of the role because I use copy configuraion file before restarting my java instance.

Do you have an idea?

yass
  • 1
  • 2
  • You have to use a different name for the file inside of the role and outside. For this, you will have to define a default value for the filename to let the user override with a different name. I explained this regarding templates in [an other answer](https://stackoverflow.com/questions/55742881/is-there-a-way-to-override-a-template-defined-into-an-ansible-galaxy-role/55749981#55749981) but the problem is exactly the same for simple files. Let me know if it fixes your issue. – Zeitounator Nov 19 '20 at 10:53
  • I have created a directory of files in the same level as roles and by doing - name: "copy file {{serviceWithoutWs}}.yml" copy: src: files/applicatif/client-service/tracing.yml dest: /opt/programmes-ful/configuration/applicatif/{{services}}/ mode: '0744' register: servicefileconfiguration if it finds the file in the role files it searches in the other directory files – yass Nov 19 '20 at 13:12

0 Answers0