robert3t

Check run level on systems running RHELish 7

Apr 9th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.28 KB | None | 0 0
  1. ---
  2. - hosts: all
  3.   tasks:
  4.     - name: Check run-level
  5.       shell: /bin/systemctl get-default
  6.       register: runlev
  7.     - name: Debug stdout capture
  8.       debug: msg=`{{ runlev.stdout | to_nice_yaml }}`
  9.       when: ansible_distribution_major_version == '7'
  10.   ignore_errors: yes
Advertisement
Add Comment
Please, Sign In to add comment