Use Git master version

The latest release is outdated
This commit is contained in:
phil 2023-08-16 21:15:16 +02:00
parent 07580cd132
commit 1f77350d70
3 changed files with 13 additions and 46 deletions

View file

@ -1,56 +1,22 @@
---
- name: "Install | Check for latest version"
ansible.builtin.shell:
cmd: curl -sL "{{ dmarcsrg_github_api_url }}" | jq -r ".tag_name"
changed_when: false
register: latest_version
- name: "Install | Get download URL"
ansible.builtin.shell:
cmd: curl -sL "{{ dmarcsrg_github_api_url }}" | jq -r ".tarball_url"
changed_when: false
register: download_url
- name: "Install | Create directories"
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
loop:
- "{{ dmarcsrg_home }}"
- "{{ dmarcsrg_home }}/{{ latest_version.stdout }}"
- "{{ overrides_path }}"
- name: "Install | Download install files"
ansible.builtin.unarchive:
src: "{{ download_url.stdout }}"
dest: "{{ dmarcsrg_home }}/{{ latest_version.stdout }}"
remote_src: true
extra_opts:
- "--strip-components=1"
- name: "Install | Clone repository"
ansible.builtin.git:
repo: "{{ dmarcsrg_githuburl }}"
dest: "{{ dmarcsrg_home }}"
version: "{{ dmarcsrg_version }}"
force: true
- name: "Install | Copy configuration file"
ansible.builtin.template:
src: conf.php.j2
dest: "{{ overrides_path }}/conf.php"
dest: "{{ dmarcsrg_home }}/config/conf.php"
mode: "0640"
owner: "{{ dmarcsrg_user }}"
group: "{{ dmarcsrg_user }}"
- name: "Install | Link data"
ansible.builtin.file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
loop:
- src: "{{ dmarcsrg_home }}/{{ latest_version.stdout }}"
dest: "{{ dmarcsrg_home }}/current"
- src: "{{ overrides_path }}/conf.php"
dest: "{{ dmarcsrg_home }}/{{ latest_version.stdout }}/config/conf.php"
- name: "Install | Initiate database"
ansible.builtin.command:
cmd: php utils/database_admin.php init
chdir: "{{ dmarcsrg_home }}/current"
chdir: "{{ dmarcsrg_home }}"
become: true
become_user: "{{ dmarcsrg_user }}"