Skip to content

Commit

Permalink
cloudplow: add target folder lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Oct 14, 2023
1 parent 8c04942 commit d9d866b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions roles/cloudplow/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@

cloudplow_name: cloudplow

################################
# Settings
################################

cloudplow_remote_default_folder: "{{ ('/' if (remote.template != 'sftp') else '') + 'Media' }}"

################################
# Lookup
################################

cloudplow_remote_folder_lookup: "{{ lookup('vars', 'cloudplow_remote_' + remote.remote + '_folder', default=cloudplow_remote_default_folder) }}"

################################
# Paths
################################
Expand Down
4 changes: 2 additions & 2 deletions roles/cloudplow/templates/config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
}
},
"remove_empty_dir_depth": 2,
"sync_remote": "{{ (remote.remote if ':' in remote.remote else remote.remote + ':' + ('/' if (remote.template != 'sftp') else '') + 'Media') if (remote.template != 'nfs') else ('/mnt/remote/' + remote.remote.split(':')[0] if ':' in remote.remote else remote.remote) + '/Media' }}",
"sync_remote": "{{ (remote.remote if ':' in remote.remote else remote.remote + ':' + cloudplow_remote_folder_lookup) if (remote.template != 'nfs') else ('/mnt/remote/' + remote.remote.split(':')[0] if ':' in remote.remote else remote.remote) + cloudplow_remote_folder_lookup }}",
"upload_folder": "{{ remote.upload_from }}",
"upload_remote": "{{ (remote.remote if ':' in remote.remote else remote.remote + ':' + ('/' if (remote.template != 'sftp') else '') + 'Media') if (remote.template != 'nfs') else ('/mnt/remote/' + remote.remote.split(':')[0] if ':' in remote.remote else remote.remote) + '/Media' }}"
"upload_remote": "{{ (remote.remote if ':' in remote.remote else remote.remote + ':' + cloudplow_remote_folder_lookup) if (remote.template != 'nfs') else ('/mnt/remote/' + remote.remote.split(':')[0] if ':' in remote.remote else remote.remote) + cloudplow_remote_folder_lookup }}"
{% if loop.index == loop.length %}}{% else %}},{{ '\n' }}{% endif %}
{% endfor %}

Expand Down

0 comments on commit d9d866b

Please sign in to comment.