diff --git a/docs/roles/composer.md b/docs/roles/composer.md index 74765170..47e40b29 100644 --- a/docs/roles/composer.md +++ b/docs/roles/composer.md @@ -14,11 +14,13 @@ composer: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/docs/roles/config_generate.md b/docs/roles/config_generate.md index fe7aecfe..b6b46aba 100644 --- a/docs/roles/config_generate.md +++ b/docs/roles/config_generate.md @@ -11,11 +11,13 @@ config_generate: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/docs/roles/deploy_code.md b/docs/roles/deploy_code.md index 5d4cc722..634dbbe5 100644 --- a/docs/roles/deploy_code.md +++ b/docs/roles/deploy_code.md @@ -89,11 +89,13 @@ deploy_code: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/docs/roles/npm.md b/docs/roles/npm.md index 97f06cdc..5a17e577 100644 --- a/docs/roles/npm.md +++ b/docs/roles/npm.md @@ -18,11 +18,13 @@ npm: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/composer/README.md b/roles/composer/README.md index 74765170..47e40b29 100644 --- a/roles/composer/README.md +++ b/roles/composer/README.md @@ -14,11 +14,13 @@ composer: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/composer/defaults/main.yml b/roles/composer/defaults/main.yml index d0dfbd1d..314f8bd0 100644 --- a/roles/composer/defaults/main.yml +++ b/roles/composer/defaults/main.yml @@ -7,11 +7,13 @@ composer: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/composer/tasks/main.yml b/roles/composer/tasks/main.yml index bba5e02a..5bf70693 100644 --- a/roles/composer/tasks/main.yml +++ b/roles/composer/tasks/main.yml @@ -25,6 +25,7 @@ src: "{{ link.src }}" dest: "{{ deploy_path }}/{{ link.dest }}" state: link + force: "{{ link.force | default(false) }}" with_items: "{{ composer.symlinks }}" loop_control: loop_var: link diff --git a/roles/config_generate/README.md b/roles/config_generate/README.md index fe7aecfe..b6b46aba 100644 --- a/roles/config_generate/README.md +++ b/roles/config_generate/README.md @@ -11,11 +11,13 @@ config_generate: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/config_generate/defaults/main.yml b/roles/config_generate/defaults/main.yml index 8f1987eb..5b4f50cf 100644 --- a/roles/config_generate/defaults/main.yml +++ b/roles/config_generate/defaults/main.yml @@ -3,11 +3,13 @@ config_generate: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/config_generate/tasks/main.yml b/roles/config_generate/tasks/main.yml index adc35b06..dacf9615 100644 --- a/roles/config_generate/tasks/main.yml +++ b/roles/config_generate/tasks/main.yml @@ -20,6 +20,7 @@ src: "{{ link.src }}" dest: "{{ deploy_path }}/{{ link.dest }}" state: link + force: "{{ link.force | default(false) }}" with_items: "{{ config_generate.symlinks }}" loop_control: loop_var: link diff --git a/roles/deploy_code/README.md b/roles/deploy_code/README.md index 5d4cc722..634dbbe5 100644 --- a/roles/deploy_code/README.md +++ b/roles/deploy_code/README.md @@ -89,11 +89,13 @@ deploy_code: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/deploy_code/defaults/main.yml b/roles/deploy_code/defaults/main.yml index b8220475..62e50b00 100644 --- a/roles/deploy_code/defaults/main.yml +++ b/roles/deploy_code/defaults/main.yml @@ -11,11 +11,13 @@ deploy_code: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/deploy_code/tasks/deploy.yml b/roles/deploy_code/tasks/deploy.yml index 032e1577..a9d74d2e 100644 --- a/roles/deploy_code/tasks/deploy.yml +++ b/roles/deploy_code/tasks/deploy.yml @@ -28,11 +28,12 @@ - deploy_code.templates | length - deploy_operation == 'deploy' -- name: Create additional symlinks. +- name: Create additional symlinks in build dir. ansible.builtin.file: src: "{{ link.src }}" dest: "{{ deploy_path }}/{{ link.dest }}" state: link + force: "{{ link.force | default(false) }}" with_items: "{{ deploy_code.symlinks }}" loop_control: loop_var: link diff --git a/roles/live_symlink/defaults/main.yml b/roles/live_symlink/defaults/main.yml index eca23ad6..51618671 100644 --- a/roles/live_symlink/defaults/main.yml +++ b/roles/live_symlink/defaults/main.yml @@ -6,11 +6,13 @@ live_symlink: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/live_symlink/tasks/main.yml b/roles/live_symlink/tasks/main.yml index fa1d9e97..d85e4e7f 100644 --- a/roles/live_symlink/tasks/main.yml +++ b/roles/live_symlink/tasks/main.yml @@ -38,7 +38,7 @@ dest: "{{ deploy_path }}/{{ link.dest }}" state: link follow: false - force: true + force: "{{ link.force | default(true) }}" with_items: "{{ live_symlink.symlinks }}" loop_control: loop_var: link diff --git a/roles/npm/README.md b/roles/npm/README.md index 97f06cdc..5a17e577 100644 --- a/roles/npm/README.md +++ b/roles/npm/README.md @@ -18,11 +18,13 @@ npm: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/npm/defaults/main.yml b/roles/npm/defaults/main.yml index a29fcac7..49321d19 100644 --- a/roles/npm/defaults/main.yml +++ b/roles/npm/defaults/main.yml @@ -11,11 +11,13 @@ npm: # Specify any additional symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') - # create: whether to create the target if it does not exists. + # force: set to true to create the symlinks in two cases: the source file does not exist but will appear later; the destination exists and is a file. # - src: '/home/{{ deploy_user }}//{{ project_name }}_{{ build_type }}/simplesaml' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: true # - src: '/var/simplesaml/etc' # dest: 'vendor/simplesamlphp/simplesamlphp/config' + # force: false symlinks: [] # Specify any additional templates to generate, with src (template) and dest (file). # src: name of a template, in the "templates" dir relative to your playbook. diff --git a/roles/npm/tasks/main.yml b/roles/npm/tasks/main.yml index f5372b0f..09487313 100644 --- a/roles/npm/tasks/main.yml +++ b/roles/npm/tasks/main.yml @@ -24,6 +24,7 @@ src: "{{ link.src }}" dest: "{{ deploy_path }}/{{ link.dest }}" state: link + force: "{{ link.force | default(false) }}" with_items: "{{ npm.symlinks }}" loop_control: loop_var: link