ansible-edda/playbooks/tasks/services/vars.yml

32 lines
975 B
YAML

- name: Set service variables
set_fact:
service_user_name: "pod-{{ service_name }}"
- name: Set service variables
set_fact:
service_home: "/var/lib/{{ ansible_hostname }}/home/{{ service_user_name }}"
- name: Set service variables
set_fact:
local_service_home: "./filesystem/{{ ansible_hostname }}/{{ service_home }}"
- name: Get user info
getent:
database: passwd
key: "{{ service_user_name }}"
- name: Set service variables
set_fact:
service_user_uid: "{{ ansible_facts.getent_passwd[service_user_name].1 }}"
service_user_gid: "{{ ansible_facts.getent_passwd[service_user_name].2 }}"
- name: Print service variables
debug:
msg:
- "service_name: {{ service_name }}"
- "service_user_name: {{ service_user_name }}"
- "service_user_uid: {{ service_user_uid }}"
- "service_user_gid: {{ service_user_gid }}"
- "service_home: {{ service_home }}"
- "local_service_home: {{ local_service_home }}"