30 lines
812 B
YAML
30 lines
812 B
YAML
- name: Determine target user
|
|
ansible.builtin.set_fact:
|
|
shell_user: "{{ shell_user | default( lookup('env','USER') ) }}"
|
|
|
|
- name: Detect platform
|
|
ansible.builtin.set_fact:
|
|
is_macos: "{{ ansible_facts['os_family'] == 'Darwin' }}"
|
|
|
|
- name: Install Stow on macOS using Homebrew cask
|
|
community.general.homebrew:
|
|
name: stow
|
|
state: present
|
|
when: is_macos
|
|
become: true
|
|
become_user: "{{ shell_user }}"
|
|
|
|
- name: Install Stow on Debian/Ubuntu
|
|
ansible.builtin.apt:
|
|
name: stow
|
|
state: present
|
|
update_cache: yes
|
|
when: not is_macos and ansible_facts['os_family'] == 'Debian'
|
|
become: true
|
|
|
|
- name: Install Stow on RedHat/CentOS/Fedora
|
|
ansible.builtin.yum:
|
|
name: stow
|
|
state: present
|
|
when: not is_macos and ansible_facts['os_family'] in ['RedHat', 'Fedora']
|
|
become: true |