Update to 2020-12-16 14:00

master
Daniel Berteaud 4 years ago
parent 23f29bf982
commit 0f6da9d5d6
  1. 2
      roles/itop/defaults/main.yml
  2. 2
      roles/itop/tasks/cleanup.yml
  3. 2
      roles/itop/tasks/conf.yml
  4. 7
      roles/itop/tasks/directories.yml
  5. 32
      roles/itop/tasks/install.yml
  6. 6
      roles/itop/templates/httpd.conf.j2
  7. 1
      roles/itop/templates/perms.sh.j2
  8. 2
      roles/itop/templates/php.conf.j2

@ -4,7 +4,7 @@ itop_id: 1
itop_manage_upgrade: True itop_manage_upgrade: True
itop_version: 2.7.2-1 itop_version: 2.7.2-1
itop_build: 6483 itop_build: 6483
itop_archive_url: https://sourceforge.net/projects/itop/files/itop/{{ item_version }}/iTop-{{ itop_version }}-{{ itop_build }}.zip itop_archive_url: https://sourceforge.net/projects/itop/files/itop/{{ itop_version }}/iTop-{{ itop_version }}-{{ itop_build }}.zip
itop_archive_sha1: 8efede1ba82ce49e35e7eee8b652a75533bfef81 itop_archive_sha1: 8efede1ba82ce49e35e7eee8b652a75533bfef81
itop_root_dir: /opt/itop_{{ itop_id }} itop_root_dir: /opt/itop_{{ itop_id }}

@ -3,7 +3,7 @@
- name: Remove temp and obsolete files - name: Remove temp and obsolete files
file: path={{ item }} state=absent file: path={{ item }} state=absent
loop: loop:
- "{{ itop_root_dir }}/tmp/iTop-{{ itop_version }}-{{ item_build }}.zip" - "{{ itop_root_dir }}/tmp/iTop-{{ itop_version }}-{{ itop_build }}.zip"
- "{{ itop_root_dir }}/tmp/web" - "{{ itop_root_dir }}/tmp/web"
- "{{ itop_root_dir }}/tmp/INSTALL" - "{{ itop_root_dir }}/tmp/INSTALL"
- "{{ itop_root_dir }}/tmp/README" - "{{ itop_root_dir }}/tmp/README"

@ -2,7 +2,7 @@
- import_tasks: ../includes/webapps_webconf.yml - import_tasks: ../includes/webapps_webconf.yml
vars: vars:
- app_id: itop_{{ dolibarr_id }} - app_id: itop_{{ itop_id }}
- php_version: "{{ itop_php_version }}" - php_version: "{{ itop_php_version }}"
- php_fpm_pool: "{{ itop_php_fpm_pool | default('') }}" - php_fpm_pool: "{{ itop_php_fpm_pool | default('') }}"
tags: itop tags: itop

@ -1,7 +1,7 @@
--- ---
- name: Create directory structure - name: Create directory structure
file: path={{ item.dir }} state=directory mode={{ item.mode | default(omit) }} file: path={{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
with_items: with_items:
- dir: "{{ itop_root_dir }}" - dir: "{{ itop_root_dir }}"
- dir: "{{ itop_root_dir }}/archives" - dir: "{{ itop_root_dir }}/archives"
@ -17,5 +17,10 @@
- dir: "{{ itop_root_dir }}/backup" - dir: "{{ itop_root_dir }}/backup"
mode: 700 mode: 700
- dir: "{{ itop_root_dir }}/data" - 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"
tags: itop tags: itop

@ -28,7 +28,39 @@
dest: "{{ itop_root_dir }}/web/" dest: "{{ itop_root_dir }}/web/"
recursive: True recursive: True
delete: 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
- name: Create directories
file: src={{ itop_root_dir }}/data/{{ item }} dest={{ itop_root_dir }}/web/{{ item }} state=link force=True
loop:
- log
- data
- conf
- env-production
- env-production-build
tags: itop
- import_tasks: ../includes/webapps_create_mysql_db.yml
vars:
- db_name: "{{ itop_db_name }}"
- db_user: "{{ itop_db_user }}"
- db_server: "{{ itop_db_server }}"
- db_pass: "{{ itop_db_pass }}"
tags: itop tags: itop
- name: Install backup hooks - name: Install backup hooks

@ -17,4 +17,8 @@ RewriteEngine On
SetHandler "proxy:unix:/run/php-fpm/{{ itop_php_fpm_pool | default('itop_' + itop_id | string) }}.sock|fcgi://localhost" SetHandler "proxy:unix:/run/php-fpm/{{ itop_php_fpm_pool | default('itop_' + itop_id | string) }}.sock|fcgi://localhost"
</FilesMatch> </FilesMatch>
</Directory> </Directory>
{% for dir in ['log','env-production','env-production-build','data','conf'] %}
<Directory {{ itop_root_dir }}/web/{{ dir }}>
Require all denied
</Directory>
{% endfor %}

@ -5,4 +5,3 @@ 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 setfacl -R -m u:{{ httpd_user | default('apache') }}:rX {{ itop_root_dir }}/data

@ -25,7 +25,7 @@ php_admin_value[memory_limit] = 512M
php_admin_value[session.save_path] = {{ itop_root_dir }}/sessions php_admin_value[session.save_path] = {{ itop_root_dir }}/sessions
php_admin_value[upload_tmp_dir] = {{ itop_root_dir }}/tmp php_admin_value[upload_tmp_dir] = {{ itop_root_dir }}/tmp
php_admin_value[sys_temp_dir] = {{ itop_root_dir }}/tmp php_admin_value[sys_temp_dir] = {{ itop_root_dir }}/tmp
php_admin_value[post_max_size] = 20M php_admin_value[post_max_size] = 21M
php_admin_value[upload_max_filesize] = 20M php_admin_value[upload_max_filesize] = 20M
php_admin_value[disable_functions] = system, show_source, symlink, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd php_admin_value[disable_functions] = system, show_source, symlink, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
php_admin_value[open_basedir] = {{ itop_root_dir }} php_admin_value[open_basedir] = {{ itop_root_dir }}

Loading…
Cancel
Save