ansible-infra/ansible_collections/nullified/infrastructure/roles/valkey/tasks/gather_facts.yml
2025-04-21 00:00:00 +00:00

16 lines
576 B
YAML

---
- name: find systemd unit directory
become: true
ansible.builtin.command: pkg-config systemd --variable=systemdsystemunitdir
changed_when: false
register: systemd_unit_directory_cmd
- name: find systemd version
become: true
ansible.builtin.shell: >
systemctl --version | awk '{if($1=="systemd" && $2~"^[0-9]+$"){print $2}}'
changed_when: false
register: systemd_version_cmd
- name: set facts
ansible.builtin.set_fact:
systemd_unit_directory: "{{ systemd_unit_directory_cmd.stdout }}"
systemd_version: "{{ systemd_version_cmd.stdout | int }}"