Merge pull request 'Feature/3456' (!7) from Feature/3456 into master

Reviewed-on: #7
This commit is contained in:
Andrea Dell'Amico 2024-05-30 14:10:44 +02:00
commit ba93602f5f
5 changed files with 49 additions and 10 deletions

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ansible-role-epas-client-timbrature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@ -11,10 +11,7 @@ The most important variables are listed below:
``` yaml
epas_client_timbrature_stack_name: 'epas_c_timbrature'
epas_client_timbrature_service_name: 'epas_timbrature'
epas_client_timbrature_docker_registry: 'docker-registry.services.iit.cnr.it'
epas_client_timbrature_docker_registry_user: 'epas.user'
epas_client_timbrature_docker_registry_pwd: 'use a vault file'
epas_client_timbrature_docker_client_timbrature_image: '{{ epas_client_timbrature_docker_registry }}/epas/area-pisa-client:stable'
epas_client_timbrature_docker_client_timbrature_image: 'consiglionazionalericerche/epas-client:area-cnr-pisa'
epas_client_timbrature_docker_client_timbrature_data_node: 'localhost'
epas_client_timbrature_data_volume: 'epas_dati_timbrature'
epas_client_timbrature_node_constraints: 'node.labels.epas_client == timbrature'
@ -22,6 +19,7 @@ epas_client_timbrature_behind_haproxy: False
epas_client_timbrature_haproxy_public_net: 'haproxy-public'
epas_client_timbrature_compose_dir: '/srv/epas_client_timbrature'
epas_client_timbrature_stampings_server_protocol: 'ftp'
epas_client_timbrature_ftp_server_name: '127.0.0.1'
epas_client_timbrature_ftp_username: 'anonymous'
#epas_client_timbrature_ftp_pwd: 'use a vault file'
@ -33,6 +31,10 @@ epas_client_timbrature_epas_server_port: 443
epas_client_timbrature_user: 'user'
#epas_client_timbrature_password: 'use a vault file'
epas_client_timbrature_loglevel: 'INFO'
epas_client_timbrature_fix_causale_pausa_pranzo: 'False'
epas_client_timbrature_causale_pausa_pranzo_min_hour: '12'
epas_client_timbrature_causale_pausa_pranzo_max_hour: '15'
epas_client_timbrature_send_all_stampings_everytime: 'True'
```
Dependencies

View File

@ -1,10 +1,14 @@
---
epas_client_timbrature_stack_name: 'epas_c_timbrature'
epas_client_timbrature_service_name: 'epas_timbrature'
epas_client_timbrature_docker_registry: 'docker-registry.services.iit.cnr.it'
epas_client_timbrature_docker_registry_user: 'epas.user'
epas_client_timbrature_docker_registry_pwd: 'use a vault file'
epas_client_timbrature_docker_client_timbrature_image: '{{ epas_client_timbrature_docker_registry }}/epas/area-pisa-client:latest'
#epas_client_timbrature_docker_registry: 'docker-registry.services.iit.cnr.it'
#epas_client_timbrature_docker_registry_user: 'epas.user'
#epas_client_timbrature_docker_registry_pwd: 'use a vault file'
#epas_client_timbrature_docker_client_timbrature_image: '{{ epas_client_timbrature_docker_registry }}/epas/area-pisa-client:latest'
epas_client_timbrature_docker_registry: ''
epas_client_timbrature_docker_registry_user: ''
epas_client_timbrature_docker_registry_pwd: ''
epas_client_timbrature_docker_client_timbrature_image: 'consiglionazionalericerche/epas-client:area-cnr-pisa'
epas_client_timbrature_docker_client_timbrature_data_node: 'localhost'
epas_client_timbrature_data_remote_volume: false
epas_client_timbrature_data_remote_volume_opts: "nfsvers=4,addr=127.0.0.1,rw"
@ -15,6 +19,7 @@ epas_client_timbrature_behind_haproxy: False
epas_client_timbrature_haproxy_public_net: 'haproxy-public'
epas_client_timbrature_compose_dir: '/srv/epas_client_timbrature'
epas_client_timbrature_stampings_server_protocol: 'ftp'
epas_client_timbrature_ftp_server_name: '127.0.0.1'
epas_client_timbrature_ftp_username: 'anonymous'
#epas_client_timbrature_ftp_pwd: 'use a vault file'
@ -26,3 +31,14 @@ epas_client_timbrature_epas_server_port: 443
epas_client_timbrature_user: 'user'
#epas_client_timbrature_password: 'use a vault file'
epas_client_timbrature_loglevel: 'INFO'
#epas_client_timbrature_regex_stamping: '^(?P<operazione>\d{2})(?P<lettore>\d{2})[!|\s](?P<causale>\d{4})\w(?P<matricolaFirma>[\w,\s,.]{17})(?P<anno>\d\d)(?P<mese>\d\d)(?P<giorno>\d\d)(?P<ora>\d\d)(?P<minuti>\d\d)$'
epas_client_timbrature_regex_stamping: '^(?P<operazione>\\\d{2})(?P<lettore>\\\d{2})[!|\\\s](?P<causale>\\\d{4})\\\w(?P<matricolaFirma>[\\\w,\\\s,.]{17})(?P<anno>\\\d\\\d)(?P<mese>\\\d\\\d)(?P<giorno>\\\d\\\d)(?P<ora>\\\d\\\d)(?P<minuti>\\\d\\\d)$'
epas_client_timbrature_offset_anno_badge: '1980'
epas_client_timbrature_fix_causale_pausa_pranzo: 'False'
epas_client_timbrature_mapping_causali_client_server: '{''0000'': None, ''2345'': None,''0001'':''motiviDiServizio''}'
epas_client_timbrature_causale_pausa_pranzo_min_hour: '12'
epas_client_timbrature_causale_pausa_pranzo_max_hour: '15'
epas_client_timbrature_send_all_stampings_everytime: 'True'

View File

@ -15,8 +15,10 @@
- name: Install the docker compose file
template: src=epas-client-timbrature-docker-compose.yml.j2 dest={{ epas_client_timbrature_compose_dir }}/docker-epas-client-timbrature-stack.yml owner=root group=root mode='0400'
- name: Login into the IIT registry
shell: docker login -u {{ epas_client_timbrature_docker_registry_user }} -p {{ epas_client_timbrature_docker_registry_pwd }} {{ epas_client_timbrature_docker_registry }}
# If registry not is docker hub
#
#- name: Login into the IIT registry
# shell: docker login -u {{ epas_client_timbrature_docker_registry_user }} -p {{ epas_client_timbrature_docker_registry_pwd }} {{ epas_client_timbrature_docker_registry }}
- name: Start the ePAS stack
docker_stack:

View File

@ -29,6 +29,7 @@ services:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
environment:
- STAMPINGS_SERVER_PROTOCOL={{ epas_client_timbrature_stampings_server_protocol }} # Protocollo per prelevare le timbrature. Possibili valori: smartclock, local, ftp, sftp
- FTP_SERVER_NAME={{ epas_client_timbrature_ftp_server_name }} # Obbligatorio
- FTP_USERNAME={{ epas_client_timbrature_ftp_username }} # Obbligatorio
- FTP_PASSWORD={{ epas_client_timbrature_ftp_pwd }} # Obbligatorio
@ -40,6 +41,13 @@ services:
- EPAS_CLIENT_USER={{ epas_client_timbrature_user }} # utente configurato in epas dentro sorgenti timbrature
- EPAS_CLIENT_PASSWORD={{ epas_client_timbrature_password }}
- LOG_LEVEL={{ epas_client_timbrature_loglevel }} # Default: INFO
- REGEX_STAMPING='{{ epas_client_timbrature_regex_stamping }}'
- OFFSET_ANNO_BADGE={{ epas_client_timbrature_offset_anno_badge }} # Default: 2000
- FIX_CAUSALE_PAUSA_PRANZO={{ epas_client_timbrature_fix_causale_pausa_pranzo}} # Default: False
- MAPPING_CAUSALI_CLIENT_SERVER='{{ epas_client_timbrature_mapping_causali_client_server }}' # Default: {'0000': None, '0001': 'motiviDiServizio', '0007': 'pausaPranzo'}
- CAUSALE_PAUSA_PRANZO_MIN_HOUR={{ epas_client_timbrature_causale_pausa_pranzo_min_hour }} # Default: 12
- CAUSALE_PAUSA_PRANZO_MAX_HOUR={{ epas_client_timbrature_causale_pausa_pranzo_max_hour }} # Default: 15
- SEND_ALL_STAMPINGS_EVERYTIME={{ epas_client_timbrature_send_all_stampings_everytime }}
#- CRON=*/30 7-22 * * * # Default: ogni mezz'ora tra le 7 e le 22. utilizzare il formato richiesto dal crontab. Riferimenti -> https://en.wikipedia.org/wiki/Cron#Examples
deploy:
mode: replicated