Update epics config with systemd timer

This commit is contained in:
2025-01-06 13:48:48 +01:00
parent 5ed9461159
commit 7336d32402
2 changed files with 48 additions and 9 deletions
+46
View File
@@ -0,0 +1,46 @@
---
- name: EPICS setup
become: true
vars:
service_name: epics_setup
block:
- name: Create systemd service file
ansible.builtin.copy:
dest: /etc/systemd/system/{{ service_name }}.service
content: |
[Unit]
Description=Update epics_contexts.yml and gfa_12_epics.sh from gfa-global-profile
[Service]
Type=oneshot
ExecStart=/usr/bin/curl -o /etc/epics_contexts.yml https://git.psi.ch/gfa_rpms/gfa-global-profile/-/raw/master/src/etc/epics_contexts.yml
ExecStart=/usr/bin/curl -o /etc/profile.d/gfa_12_epics.sh https://git.psi.ch/gfa_rpms/gfa-global-profile/-/raw/master/src/etc/profile.d/gfa_12_epics.sh
User=root
- name: Trigger epics_setup service
ansible.builtin.systemd_service:
name: "{{ service_name }}.service"
state: started
daemon_reload: true
- name: Create systemd timer file
ansible.builtin.copy:
dest: /etc/systemd/system/{{ service_name }}.timer
content: |
[Unit]
Description=Timer to update epics_contexts.yml and gfa_12_epics.sh from gfa-global-profile
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
- name: Enable and start systemd timer
ansible.builtin.systemd_service:
name: "{{ service_name }}.timer"
enabled: yes
state: started
daemon_reload: true
+2 -9
View File
@@ -20,15 +20,8 @@
- tmux
state: latest
- name: Download epics_contexts.yml
ansible.builtin.uri:
url: https://git.psi.ch/gfa_rpms/gfa-global-profile/-/raw/master/src/etc/epics_contexts.yml
dest: /etc
- name: Download gfa_12_epics.sh
ansible.builtin.uri:
url: https://git.psi.ch/gfa_rpms/gfa-global-profile/-/raw/master/src/etc/profile.d/gfa_12_epics.sh
dest: /etc/profile.d
- name: EPICS setup
include_tasks: epics_setup.yaml
- name: Create a folder for BEC deployment
become_user: "{{ bec_user }}"