Skip to content

Instantly share code, notes, and snippets.

Created Feb 20, 2014
What would you like to do?
Ansible: Check command output, react in next task
- name: Red Hat - Check subscription status
shell: /usr/sbin/subscription-manager list
register: subs
when: ansible_distribution == 'RedHat'
- name: Red Hat - Ensure registered to RHN (1/2)
shell: /usr/sbin/subscription-manager register --username USER --password PASS
when: ansible_distribution == 'RedHat' and "Subscribed" not in subs.stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment