Skip to content

Commit

Permalink
Add better version update
Browse files Browse the repository at this point in the history
  • Loading branch information
supertarto committed Sep 6, 2024
1 parent d2f6202 commit c3520b1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ glpi_db_password: "changeit!"
- listen_ip: "*"
listen_port: 80
server_name: host1
documentroot: "/var/www/glpi"
documentroot: "/var/www/glpi/public"
serveradmin: admin@localhost
custom_param: |
ErrorLog ${APACHE_LOG_DIR}/error.log
Expand Down
42 changes: 42 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
path: "{{ glpi_install_path }}/glpi"
register: glpiinstalled

- block:

- name: Check if GLPI Backup already exists

Check failure on line 9 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

9:3 [indentation] wrong indentation: expected 4 but found 2
stat:
path: "{{ glpi_install_path }}/glpi-bck"
register: glpibackup

- name: Remove Old GLPI Backup folder before update
ansible.builtin.file:
path: "{{ glpi_install_path }}/glpi-bck"
state: absent
when: glpibackup

- name: BackUp GLPI Folder
ansible.builtin.copy:
remote_src: true
src: "{{ glpi_install_path }}/glpi"
dest: "{{ glpi_install_path }}/glpi-bck"

- name: Remove GLPI folder before update
ansible.builtin.file:
path: "{{ glpi_install_path }}/glpi"
state: absent

when: glpi_update and glpiinstalled

- name: Download and extract GLPI
unarchive:
src: "{{ glpi_download_url }}"
Expand All @@ -23,6 +49,22 @@
- Remove install.php
- Add htaccess

- block:

- name: Copy files directory from backup to new version

Check failure on line 54 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

54:3 [indentation] wrong indentation: expected 4 but found 2
ansible.builtin.copy:
remote_src: true
src: "{{ glpi_install_path }}/glpi-bck/files"
dest: "{{ glpi_install_path }}/glpi/files"

- name: Copy config directory from backup to new version
ansible.builtin.copy:
remote_src: true
src: "{{ glpi_install_path }}/glpi-bck/config"
dest: "{{ glpi_install_path }}/glpi/config"

when: glpi_update and glpiinstalled

- name: Set permisions to files directory
file:
path: "{{ glpi_install_path }}/glpi/files"
Expand Down

0 comments on commit c3520b1

Please sign in to comment.