Closed Gomez closed 8 years ago
Is it OK if we use "copy" rather than "synchronize"?
"synchronize" has some problems I can't find a way around. If you use it delegated to the inventory host, it's going to need to be able to open a connection to the ansible host machine. If not delegated, it may have permission problems since it will try to create files as the remote ansible user rather than the buildout user.
Does https://github.com/plone/ansible.plone_server/pull/59 do what you want? It's your pull modified to use copy rather than synchronize.
Thanks @smcmahon I will check it out soon.
My approach is on the destination server. I have some tasks before ansible.plone_server:
- name: Copy starzel.buildout local.cfg to plone_buildout_extra_dir
copy:
content: "[buildout]\nextends = local_develop.cfg\n"
dest: "{{ servers[0]['plone_target_path'] }}/buildout_extra_dir/local.cfg"
force: no
owner: 'plone_buildout'
group: 'plone_group'
- name: Copy starzel.buildout secret.cfg to plone_buildout_extra_dir
copy:
content: "[buildout]\nlogin = admin\npassword = admin\n"
dest: "{{ servers[0]['plone_target_path'] }}/buildout_extra_dir/secret.cfg"
force: no
owner: 'plone_buildout'
group: 'plone_group'
They create the files on the destination server. I don't need them on the ansible controller or in git.
"Copy" would transfer files from the ansible controller to the destination server, that would work too. I am not sure which one to prefer?
Fixes https://github.com/plone/ansible.plone_server/issues/54
Replaces: https://github.com/plone/ansible.plone_server/pull/56
@smcmahon Done as you suggested.