Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fworch_parent_dir: "/usr/local"
fworch_home: "{{ fworch_parent_dir }}/{{ product_name }}"
fworch_conf_dir: "{{ fworch_home }}/etc"
fworch_conf_file: "{{ fworch_conf_dir }}/fworch.json"
last_commit_id_file_path: "{{ fworch_conf_dir }}/last_commit_id.txt"
fworch_secrets_dir: "{{ fworch_conf_dir }}/secrets"
importer_venv_dir: "{{ fworch_home }}/importer/importer-venv"

Expand Down
23 changes: 23 additions & 0 deletions roles/common/tasks/last_commit_id_file_creator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- block:
- name: remove local copy of remote config file
file:
state: absent
name: "temp_remote_config_file.json"

- name: get last commit id
command: git rev-parse HEAD
register: final_commit_id
failed_when: false
changed_when: false

# also handle case where we are not inside a git repo
- name: determine commit id content
set_fact:
final_commit_id_value: "{{ final_commit_id.stdout if final_commit_id.rc == 0 else 'unknown' }}"

- name: write commit id to last_commit_id.txt file
copy:
content: "{{ final_commit_id_value }}"
dest: "{{ last_commit_id_file_path }}"

become: true
3 changes: 3 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@
- name: include fworch.yaml config file creator
import_tasks: conf_file_creator.yml

- name: include last_commit_id.txt file creator
import_tasks: last_commit_id_file_creator.yml

- name: include upgrade script
import_tasks: run-upgrades.yml
when: "installation_mode == 'upgrade'"
Expand Down
Loading