Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. # vim: set ft=ansible:
  2. ---
  3. - name: Force unregister before register
  4. redhat_subscription:
  5. state: absent
  6. register: task_result
  7. until: task_result | succeeded
  8. retries: 10
  9. delay: 5
  10.  
  11. - name: register node with subscription-manager
  12. redhat_subscription:
  13. state: present
  14. username: "{{ rhel_subscription_user }}"
  15. password: "{{ rhel_subscription_pass }}"
  16. autosubscribe: false
  17. register: task_result
  18. until: task_result | succeeded
  19. retries: 10
  20. delay: 5
  21.  
  22. # TODO: should take pool ids from a var
  23. - name: get openshift pool id
  24. shell: /usr/bin/subscription-manager list --all --available --matches="*OpenShift Container Platform*" | awk '/Pool ID/ {print $3}' | head -1
  25. # command: subscription-manager list --all --available --matches="OpenShift Container Platform" | awk '/Pool ID/ {print $3}' | head -1
  26. register: pool_id
  27. until: pool_id | succeeded
  28. retries: 10
  29. delay: 5
  30.  
  31. - name: attach host to subscription pool
  32. shell: /usr/bin/subscription-manager attach --pool={{ pool_id.stdout }}
  33. register: task_result
  34. until: task_result.rc == 0
  35. retries: 10
  36. delay: 5
  37. ignore_errors: no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement