Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Create VM based on template
- hosts: ovirt-engine
- become: yes
- become_method: sudo
- vars:
- - temp: '{{temp_fedora25}}'
- - iname:
- - db-aa
- - db-ab
- - db-ac
- tasks:
- - name: Giving Birth to lil Baby VM's
- ovirt:
- user: '{{ovirt_usr}}'
- password: '{{ovirt_pass}}'
- url: '{{engine_url}}'
- instance_name: "{{item}}"
- instance_nic: ovirtmgmt
- resource_type: template
- image: '{{temp}}'
- zone: superblade-a
- disk_alloc: preallocated
- with_items: "{{iname}}"
- - name: numeric
- debug:
- msg: "{{ item }}"
- with_sequence: start=1 count=10 format=server-%0d
- - name: characters from small 'a'
- debug:
- msg: "{{ item }}"
- with_sequence: start=0x61 count=10 format=server-%c
- - name: save for future use
- set_fact:
- my_seq: "{{ lookup('sequence','start={} count={} format={}{}'.format(beg,cnt,pref,fmt),wantlist=True) }}"
- vars:
- beg: 1
- cnt: 10
- pref: host-
- fmt: '%0d'
- ---
- - name: Create VM based on template
- hosts: ovirt-engine
- become: yes
- become_method: sudo
- vars:
- - temp: '{{temp_fedora25}}'
- - host_pre: db
- - host_seq: a%c
- - host_cnt: 3
- - host_srt: 0x61
- tasks:
- - name: Giving Birth to lil Baby VM's
- ovirt:
- user: '{{ovirt_usr}}'
- password: '{{ovirt_pass}}'
- url: '{{engine_url}}'
- instance_name: "{{item}}"
- instance_nic: ovirtmgmt
- resource_type: template
- image: '{{temp}}'
- zone: superblade-a
- disk_alloc: preallocated
- with_sequence: start="{{host_srt}}" count="{{host_cnt}}" format="{{host_pre}}-{{host_seq}}"
Add Comment
Please, Sign In to add comment