Guest User

Untitled

a guest
Jun 12th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. ---
  2. - name: Create VM based on template
  3. hosts: ovirt-engine
  4. become: yes
  5. become_method: sudo
  6.  
  7. vars:
  8. - temp: '{{temp_fedora25}}'
  9. - iname:
  10. - db-aa
  11. - db-ab
  12. - db-ac
  13.  
  14. tasks:
  15.  
  16. - name: Giving Birth to lil Baby VM's
  17. ovirt:
  18. user: '{{ovirt_usr}}'
  19. password: '{{ovirt_pass}}'
  20. url: '{{engine_url}}'
  21. instance_name: "{{item}}"
  22. instance_nic: ovirtmgmt
  23. resource_type: template
  24. image: '{{temp}}'
  25. zone: superblade-a
  26. disk_alloc: preallocated
  27. with_items: "{{iname}}"
  28.  
  29. - name: numeric
  30. debug:
  31. msg: "{{ item }}"
  32. with_sequence: start=1 count=10 format=server-%0d
  33.  
  34.  
  35. - name: characters from small 'a'
  36. debug:
  37. msg: "{{ item }}"
  38. with_sequence: start=0x61 count=10 format=server-%c
  39.  
  40. - name: save for future use
  41. set_fact:
  42. my_seq: "{{ lookup('sequence','start={} count={} format={}{}'.format(beg,cnt,pref,fmt),wantlist=True) }}"
  43. vars:
  44. beg: 1
  45. cnt: 10
  46. pref: host-
  47. fmt: '%0d'
  48.  
  49. ---
  50. - name: Create VM based on template
  51. hosts: ovirt-engine
  52. become: yes
  53. become_method: sudo
  54.  
  55. vars:
  56. - temp: '{{temp_fedora25}}'
  57. - host_pre: db
  58. - host_seq: a%c
  59. - host_cnt: 3
  60. - host_srt: 0x61
  61.  
  62. tasks:
  63.  
  64. - name: Giving Birth to lil Baby VM's
  65. ovirt:
  66. user: '{{ovirt_usr}}'
  67. password: '{{ovirt_pass}}'
  68. url: '{{engine_url}}'
  69. instance_name: "{{item}}"
  70. instance_nic: ovirtmgmt
  71. resource_type: template
  72. image: '{{temp}}'
  73. zone: superblade-a
  74. disk_alloc: preallocated
  75. with_sequence: start="{{host_srt}}" count="{{host_cnt}}" format="{{host_pre}}-{{host_seq}}"
Add Comment
Please, Sign In to add comment