mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-01 18:20:15 +00:00
New VM improvements
This commit is contained in:
1 parent
ebc1b4901e
commit
3686d7f627
7 files changed
+180
-29
No files matched your search
@@ -0,0 +1,78 @@
|
||||
---
|
||||
- name: delete metadata from instance
|
||||
vars:
|
||||
vm_name: "{{ os_project }}-{{ win_project }}-wb{{ '%02d' | format(item+1+wb_quantity|int) }}"
|
||||
openstack.cloud.server_metadata:
|
||||
state: absent
|
||||
cloud: "{{ os_project }}"
|
||||
name: "{{ vm_name }}"
|
||||
meta:
|
||||
new_vm:
|
||||
loop: "{{ range(new_wb_quantity|int)|list }}"
|
||||
|
||||
- name: Increase workbench quantity variable
|
||||
ansible.builtin.lineinfile:
|
||||
path: /deployments/{{ os_project }}-{{ win_project }}/ansible/vars/common.yml
|
||||
regexp: '^wb_quantity:\s*\d+'
|
||||
line: "wb_quantity: {{ wb_quantity + new_wb_quantity | int }}"
|
||||
|
||||
|
||||
- name: delete metadata from application VMs
|
||||
vars:
|
||||
vm_name: "{{ os_project }}-{{ win_project }}-app{{ '%02d' | format(item+1+app_quantity|int) }}"
|
||||
openstack.cloud.server_metadata:
|
||||
state: absent
|
||||
cloud: "{{ os_project }}"
|
||||
name: "{{ vm_name }}"
|
||||
meta:
|
||||
new_vm:
|
||||
loop: "{{ range(new_app_quantity|int)|list }}"
|
||||
|
||||
- name: Increase workbench quantity variable
|
||||
ansible.builtin.lineinfile:
|
||||
path: /deployments/{{ os_project }}-{{ win_project }}/ansible/vars/common.yml
|
||||
regexp: '^wb_quantity:\s*\d+'
|
||||
line: "wb_quantity: {{ app_quantity + new_app_quantity | int }}"
|
||||
|
||||
- name: delete metadata from instance
|
||||
vars:
|
||||
vm_name: "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1+gpu_quantity|int) }}"
|
||||
openstack.cloud.server_metadata:
|
||||
state: absent
|
||||
cloud: "{{ os_project }}"
|
||||
name: "{{ vm_name }}"
|
||||
meta:
|
||||
new_vm:
|
||||
loop: "{{ range(new_gpu_quantity|int)|list }}"
|
||||
|
||||
- name: Increase workbench quantity variable
|
||||
ansible.builtin.lineinfile:
|
||||
path: /deployments/{{ os_project }}-{{ win_project }}/ansible/vars/common.yml
|
||||
regexp: '^gpu_quantity:\s*\d+'
|
||||
line: "wb_quantity: {{ gpu_quantity + new_gpu_quantity | int }}"
|
||||
|
||||
|
||||
#- name: Remove temporary metadata
|
||||
# tags: remove_metadata
|
||||
# block:
|
||||
# - name: Remove new metadata tag from GPU VMs
|
||||
# shell: |
|
||||
# export OS_CLIENT_CONFIG_FILE=/deployments/{{ os_project }}-{{ win_project }}/clouds.yaml
|
||||
# export OS_CLOUD={{ os_project }}
|
||||
# openstack server unset --property new_vm "{{ os_project }}-{{ win_project }}-wb{{ '%02d' | format(item+1|int) }}"
|
||||
# loop: "{{ range(wb_quantity|int)|list }}"
|
||||
#
|
||||
# - name: Remove new metadata tag from GPU VMs
|
||||
# shell: |
|
||||
# export OS_CLIENT_CONFIG_FILE=/deployments/{{ os_project }}-{{ win_project }}/clouds.yaml
|
||||
# export OS_CLOUD={{ os_project }}
|
||||
# openstack server unset --property new_vm "{{ os_project }}-{{ win_project }}-app{{ '%02d' | format(item+1|int) }}"
|
||||
# loop: "{{ range(app_quantity|int)|list }}"
|
||||
#
|
||||
# - name: Remove new metadata tag from GPU VMs
|
||||
# shell: |
|
||||
# export OS_CLIENT_CONFIG_FILE=/deployments/{{ os_project }}-{{ win_project }}/clouds.yaml
|
||||
# export OS_CLOUD={{ os_project }}
|
||||
# openstack server unset --property new_vm "{{ os_project }}-{{ win_project }}-gpu{{ '%02d' | format(item+1|int) }}"
|
||||
# loop: "{{ range(gpu_quantity|int)|list }}"
|
||||
|
||||
Reference in new issue
Block a user