diff --git a/tasks/swift_storage_hosts_object.yml b/tasks/swift_storage_hosts_object.yml index 7da297fb..48b1f8ca 100644 --- a/tasks/swift_storage_hosts_object.yml +++ b/tasks/swift_storage_hosts_object.yml @@ -63,10 +63,37 @@ config_overrides: "{{ swift_drive_audit_conf_overrides }}" config_type: "ini" +# TODO: This can be safely removed in 2025.2 cycle - name: Create drive-audit cron job ansible.builtin.cron: name: "Run drive-audit script" - job: "{{ swift_bin }}/swift-drive-audit /etc/swift/drive-audit.conf" - minute: 15 - cron_file: swift-drive-audit - user: root + state: absent + +- name: Create drive-audit systemd timer + ansible.builtin.include_role: + name: systemd_service + vars: + systemd_service_restart_changed: false + systemd_user_name: "root" + systemd_group_name: "root" + systemd_tempd_prefix: openstack + systemd_slice_name: "{{ swift_system_slice_name }}" + systemd_lock_dir: "{{ swift_lock_dir }}" + systemd_service_restart: on-abnormal + systemd_services: + - service_name: "swift-drive-audit" + execstarts: + - "{{ swift_bin }}/swift-drive-audit /etc/swift/drive-audit.conf" + environment: + UMASK: "0640" + UMASK_DIR: "0750" + program_sandboxing: + RuntimeDirectory: "swift-drive-audit" + enabled: true + timer: + state: 'started' + enabled: true + options: + OnCalendar: "*:0/15" + Persistent: true + Unit: "swift-drive-audit.service" diff --git a/tasks/swift_storage_hosts_setup.yml b/tasks/swift_storage_hosts_setup.yml index e8aef3d9..e236b21b 100644 --- a/tasks/swift_storage_hosts_setup.yml +++ b/tasks/swift_storage_hosts_setup.yml @@ -54,13 +54,40 @@ when: ansible_facts['pkg_mgr'] =="apt" notify: "Restart rsync service" +# TODO: This can be safely removed in 2025.2 cycle - name: "Setup swift-recon-cron cron job" ansible.builtin.cron: name: "swift-recon-cron run" - minute: "*/5" - user: "swift" - job: "{{ recon_cron_path }} /etc/swift/object-server/object-server.conf" - cron_file: "swift_recon_cron" + state: absent + +- name: Setup swift-recon-cron systemd timer + ansible.builtin.include_role: + name: systemd_service + vars: + systemd_service_restart_changed: false + systemd_user_name: "{{ swift_system_user_name }}" + systemd_group_name: "{{ swift_system_group_name }}" + systemd_tempd_prefix: openstack + systemd_slice_name: "{{ swift_system_slice_name }}" + systemd_lock_dir: "{{ swift_lock_dir }}" + systemd_service_restart: on-abnormal + systemd_services: + - service_name: "swift-recon-cron" + execstarts: + - "{{ recon_cron_path }} /etc/swift/object-server/object-server.conf" + environment: + UMASK: "0640" + UMASK_DIR: "0750" + program_sandboxing: + RuntimeDirectory: "swift-recon-cron" + enabled: true + timer: + state: 'started' + enabled: true + options: + OnCalendar: "*:0/5" + Persistent: true + Unit: "swift-recon-cron.service" - name: "Set ownership on mounted drives" ansible.builtin.file: