add force site update

This commit is contained in:
vincent 2019-04-26 14:19:42 +02:00
parent 33b7061716
commit dd34042620
2 changed files with 6 additions and 4 deletions

View File

@ -10,3 +10,4 @@ backendfolder: backend
exec_user: root exec_user: root
exec_group: root exec_group: root
repo: gitea@pi2:vincent/chainetv_web.git repo: gitea@pi2:vincent/chainetv_web.git
force_site_update: false

View File

@ -10,17 +10,17 @@
dest: "/tmp/{{name}}" # required. The path of where the repository should be checked out. This parameter is required, unless C(clone) is set to C(no). dest: "/tmp/{{name}}" # required. The path of where the repository should be checked out. This parameter is required, unless C(clone) is set to C(no).
repo: "{{repo}}" # required. git, SSH, or HTTP(S) protocol address of the git repository. repo: "{{repo}}" # required. git, SSH, or HTTP(S) protocol address of the git repository.
clone: yes # not required. If C(no), do not clone the repository if it does not exist locally clone: yes # not required. If C(no), do not clone the repository if it does not exist locally
when: location_stat.stat.exists == false when: location_stat.stat.exists == false or force_site_update == true
- name: compile client source - name: compile client source
shell: "/tmp/{{name}}/deploy_client.sh" shell: "/tmp/{{name}}/deploy_client.sh"
when: location_stat.stat.exists == false when: location_stat.stat.exists == false or force_site_update == true
- name: copy source - name: copy source
synchronize: synchronize:
dest: "{{source_location}}" # required. Remote absolute path where the file should be copied to. If I(src) is a directory, this must be a directory too. If I(dest) is a nonexistent path and if either I(dest) ends with "/" or I(src) is a directory, I(dest) is created. If I(src) and I(dest) are files, the parent directory of I(dest) isn't created: the task fails if it doesn't already exist. dest: "{{source_location}}" # required. Remote absolute path where the file should be copied to. If I(src) is a directory, this must be a directory too. If I(dest) is a nonexistent path and if either I(dest) ends with "/" or I(src) is a directory, I(dest) is created. If I(src) and I(dest) are files, the parent directory of I(dest) isn't created: the task fails if it doesn't already exist.
src: "/tmp/{{name}}/{{backendfolder}}/" # not required. Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with "/", only inside contents of that directory are copied to destination. Otherwise, if it does not end with "/", the directory itself with all contents is copied. This behavior is similar to Rsync. src: "/tmp/{{name}}/{{backendfolder}}/" # not required. Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with "/", only inside contents of that directory are copied to destination. Otherwise, if it does not end with "/", the directory itself with all contents is copied. This behavior is similar to Rsync.
when: location_stat.stat.exists == false when: location_stat.stat.exists == false or force_site_update == true
delegate_to: "{{ inventory_hostname }}" delegate_to: "{{ inventory_hostname }}"
become: yes become: yes
@ -28,7 +28,7 @@
file: file:
path: "/tmp/{{name}}" path: "/tmp/{{name}}"
state: absent state: absent
when: location_stat.stat.exists == false when: location_stat.stat.exists == false or force_site_update == true
- name: ensure venv folder exist - name: ensure venv folder exist
file: file:
@ -73,3 +73,4 @@
become: yes become: yes
notify: notify:
- Reload systemd - Reload systemd
- restart service