Update to 2020-12-16 17:00

master
Daniel Berteaud 4 years ago
parent 0f6da9d5d6
commit 8a674e5b59
  1. 12
      roles/itop/tasks/directories.yml
  2. 48
      roles/itop/tasks/install.yml
  3. 6
      roles/itop/templates/perms.sh.j2

@ -16,11 +16,11 @@
mode: 700 mode: 700
- dir: "{{ itop_root_dir }}/backup" - dir: "{{ itop_root_dir }}/backup"
mode: 700 mode: 700
- dir: "{{ itop_root_dir }}/data" - dir: "{{ itop_root_dir }}/web/data"
- dir: "{{ itop_root_dir }}/data/conf" - dir: "{{ itop_root_dir }}/web/conf"
- dir: "{{ itop_root_dir }}/data/data" - dir: "{{ itop_root_dir }}/web/env-production"
- dir: "{{ itop_root_dir }}/data/log" - dir: "{{ itop_root_dir }}/web/env-production-build"
- dir: "{{ itop_root_dir }}/data/env-production" - dir: "{{ itop_root_dir }}/web/log"
- dir: "{{ itop_root_dir }}/data/env-production-build" - dir: "{{ itop_root_dir }}/web/extensions"
tags: itop tags: itop

@ -21,36 +21,44 @@
src: "{{ itop_root_dir }}/tmp/iTop-{{ itop_version }}-{{ itop_build }}.zip" src: "{{ itop_root_dir }}/tmp/iTop-{{ itop_version }}-{{ itop_build }}.zip"
dest: "{{ itop_root_dir }}/tmp" dest: "{{ itop_root_dir }}/tmp"
remote_src: yes remote_src: yes
- name: Remove previous install
file: path={{ itop_root_dir }}/web/{{ item }} state=absent
loop:
- addons
- datamodels
- images
- lib
- manifest.xml
- portal
- application
- core
- dictionnaries
- env-test
- index.php
- navigator
- setup
- webservices
- approot.inc.php
- css
- js
- pages
- synchro
- sources
- documentation
- name: Move files to the correct directory - name: Install new version of iTop
synchronize: synchronize:
src: "{{ itop_root_dir }}/tmp/web/" src: "{{ itop_root_dir }}/tmp/web/"
dest: "{{ itop_root_dir }}/web/" dest: "{{ itop_root_dir }}/web/"
recursive: True recursive: True
delete: True
rsync_opts:
- '--exclude=data'
- '--exclude=log'
delegate_to: "{{ inventory_hostname }}" delegate_to: "{{ inventory_hostname }}"
- name: Sync data and log dir
synchronize:
src: "{{ itop_root_dir }}/tmp/web/{{ item }}/"
dest: "{{ itop_root_dir }}/data/{{ item }}/"
recursive: True
delegate_to: "{{ inventory_hostname }}"
loop:
- data
- log
tags: itop tags: itop
- name: Create directories - name: Ensure env-production directories exist
file: src={{ itop_root_dir }}/data/{{ item }} dest={{ itop_root_dir }}/web/{{ item }} state=link force=True file: path={{ itop_root_dir }}/web/{{ item }} state=directory
loop: loop:
- log
- data
- conf
- env-production - env-production
- env-production-build - env-production-build
tags: itop tags: itop

@ -3,5 +3,9 @@
restorecon -R {{ itop_root_dir }} restorecon -R {{ itop_root_dir }}
chown -R {{ itop_php_user }} {{ itop_root_dir }}/data chown -R {{ itop_php_user }} {{ itop_root_dir }}/data
chmod 700 {{ itop_root_dir }}/data chmod 700 {{ itop_root_dir }}/data
setfacl -R -m u:{{ httpd_user | default('apache') }}:rX {{ itop_root_dir }}/data {% for dir in ['data', 'conf', 'log', 'env-production', 'env-production-build', 'extensions'] %}
setfacl -k -b -R {{ itop_root_dir }}/web/{{ dir }}
chown -R {{ itop_php_user }} {{ itop_root_dir }}/web/{{ dir }}
setfacl -R -m u:{{ httpd_user | default('apache') }}:rX {{ itop_root_dir }}/web/{{ dir }}
{% endfor %}

Loading…
Cancel
Save