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
- dir: "{{ itop_root_dir }}/backup"
mode: 700
- dir: "{{ itop_root_dir }}/data"
- dir: "{{ itop_root_dir }}/data/conf"
- dir: "{{ itop_root_dir }}/data/data"
- dir: "{{ itop_root_dir }}/data/log"
- dir: "{{ itop_root_dir }}/data/env-production"
- dir: "{{ itop_root_dir }}/data/env-production-build"
- dir: "{{ itop_root_dir }}/web/data"
- dir: "{{ itop_root_dir }}/web/conf"
- dir: "{{ itop_root_dir }}/web/env-production"
- dir: "{{ itop_root_dir }}/web/env-production-build"
- dir: "{{ itop_root_dir }}/web/log"
- dir: "{{ itop_root_dir }}/web/extensions"
tags: itop

@ -22,35 +22,43 @@
dest: "{{ itop_root_dir }}/tmp"
remote_src: yes
- name: Move files to the correct directory
- 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: Install new version of iTop
synchronize:
src: "{{ itop_root_dir }}/tmp/web/"
dest: "{{ itop_root_dir }}/web/"
recursive: True
delete: True
rsync_opts:
- '--exclude=data'
- '--exclude=log'
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
- name: Create directories
file: src={{ itop_root_dir }}/data/{{ item }} dest={{ itop_root_dir }}/web/{{ item }} state=link force=True
- name: Ensure env-production directories exist
file: path={{ itop_root_dir }}/web/{{ item }} state=directory
loop:
- log
- data
- conf
- env-production
- env-production-build
tags: itop

@ -3,5 +3,9 @@
restorecon -R {{ itop_root_dir }}
chown -R {{ itop_php_user }} {{ 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