18 lines
368 B
YAML
18 lines
368 B
YAML
|
|
---
|
||
|
|
- hosts: localhost
|
||
|
|
connection: local
|
||
|
|
force_handlers: true
|
||
|
|
|
||
|
|
pre_tasks:
|
||
|
|
- set_fact:
|
||
|
|
eff_uid_number: "{{ lookup('pipe', 'id -u') }}"
|
||
|
|
|
||
|
|
- block:
|
||
|
|
- debug:
|
||
|
|
msg: "This program requires root privileges"
|
||
|
|
- meta: end_play
|
||
|
|
when: eff_uid_number|int != 0
|
||
|
|
|
||
|
|
roles:
|
||
|
|
- name: fedora
|
||
|
|
when: ansible_distribution == 'Fedora'
|