Update to 2021-08-03 09:00

master
Daniel Berteaud 3 years ago
parent ca2f280d24
commit b84d0c8d90
  1. 7
      roles/akeneo_pim/handlers/main.yml
  2. 57
      roles/akeneo_pim/tasks/conf.yml
  3. 16
      roles/akeneo_pim/tasks/install.yml
  4. 8
      roles/akeneo_pim/tasks/services.yml
  5. 22
      roles/akeneo_pim/templates/akeneo-pim-events-api.service.j2
  6. 22
      roles/akeneo_pim/templates/akeneo-pim-jobs.service.j2

@ -0,0 +1,7 @@
---
- name: restart akeneo-pim
service: name={{ item }} state=restarted
loop:
- akeneo-pim_{{ pim_id }}-jobs
- akeneo-pim_{{ pim_id }}-events-api

@ -30,3 +30,60 @@
command: "{{ pim_root_dir }}/perms.sh" command: "{{ pim_root_dir }}/perms.sh"
when: pim_perm_script.changed or pim_install_mode != 'none' when: pim_perm_script.changed or pim_install_mode != 'none'
tags: pim tags: pim
- name: Setup cron jobs
cron:
cron_file: akeneopim_{{ pim_id }}
user: "{{ pim_user }}"
name: "{{ item.name }}"
job: /bin/php{{ pim_php_version }} {{ pim_root_dir }}/app/bin/console {{ item.job }}
minute: "{{ item.minute | default('*') }}"
hour: "{{ item.hour | default('*') }}"
weekday: "{{ item.weekday | default('*') }}"
day: "{{ item.day | default('*') }}"
month: "{{ item.month | default('*') }}"
loop:
- name: refresh
job: pim:versioning:refresh
minute: 30
hour: 1
- name: purge
job: pim:versioning:purge --more-than-days 90 --no-interaction --force
minute: 30
hour: 2
- name: update-data
job: akeneo:connectivity-audit:update-data
minute: 1
- name: purge-errors
job: akeneo:connectivity-connection:purge-error
minute: 10
- name: purge-job-execution
job: akeneo:batch:purge-job-execution
minute: 20
hour: 0
day: 1
- name: purge-error-count
job: akeneo:connectivity-audit:purge-error-count
minute: 40
hour: 0
- name: aggregate
job: pim:volume:aggregate
minute: 30
hour: 4
- name: schedule-periodic-tasks
job: pim:data-quality-insights:schedule-periodic-tasks
minute: 15
hour: 0
- name: prepare-evaluations
job: pim:data-quality-insights:prepare-evaluations
minute: '*/10'
- name: evaluations
job: pim:data-quality-insights:evaluations
minute: '*/30'
- name: purge-messages
job: akeneo:messenger:doctrine:purge-messages messenger_messages default
minute: 0
hour: '*/2'
tags: pim

@ -70,3 +70,19 @@
- pre - pre
- post - post
tags: pim tags: pim
- name: Install job consumer and events api service units
template: src={{ item.src }} dest=/etc/systemd/system/{{ item.dest }}
loop:
- src: akeneo-pim-jobs.service.j2
dest: akeneo-pim_{{ pim_id }}-jobs.service
- src: akeneo-pim-events-api.service.j2
dest: akeneo-pim_{{ pim_id }}-events-api.service
register: pim_job_unit
notify: restart akeneo-pim
tags: pim
- name: Reload systemd
systemd: daemon_reload=True
when: pim_job_unit.results | selectattr('changed','equalto',True) | list | length > 0
tags: pim

@ -0,0 +1,8 @@
---
- name: Start services
service: name={{ item }} state=started enabled=True
loop:
- akeneo-pim_{{ pim_id }}-jobs
- akeneo-pim_{{ pim_id }}-events-api
tags: pim

@ -0,0 +1,22 @@
[Unit]
Description=Akeneo Events API worker for PIM {{ pim_id }}
[Service]
User={{ pim_user }}
Group={{ pim_user }}
WorkingDirectory={{ pim_root_dir }}/app
ExecStart=/bin/php{{ pim_php_version }} bin/console messenger:consume webhook --env=prod
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes
MemoryLimit=1024M
SyslogIdentifier=akeneo-pim_{{ pim_id }}-events-api
Restart=on-failure
StartLimitInterval=0
RestartSec=30
[Install]
WantedBy=multi-user.target

@ -0,0 +1,22 @@
[Unit]
Description=Akeneo jobs worker for PIM {{ pim_id }}
[Service]
User={{ pim_user }}
Group={{ pim_user }}
WorkingDirectory={{ pim_root_dir }}/app
ExecStart=/bin/php{{ pim_php_version }} bin/console akeneo:batch:job-queue-consumer-daemon --env=prod
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes
MemoryLimit=1024M
SyslogIdentifier=akeneo-pim_{{ pim_id }}-jobs
Restart=on-failure
StartLimitInterval=0
RestartSec=30
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save