目前,我當場EC2配置戲看起來是這樣的:是否有可能在Ansible中執行其他檢查?
- name: Provisioning Spot instaces
ec2:
spot_price: 0.50
spot_wait_timeout: 300
assign_public_ip: no
aws_access_key: "{{ aws_id }}"
aws_secret_key: "{{ aws_key }}"
region: "{{ aws_region }}"
image: "{{ image_instance }}"
instance_type: "{{ large_instance }}"
key_name: "{{ ssh_keyname }}"
count: 3
state: present
group_id: "{{ cypher_priv_sg }}"
vpc_subnet_id: "{{ private_subnet_id }}"
wait: true
instance_tags:
Name: Cypher-Worker
#delete_on_termination: yes
register: ec2
那麼,是不是可以做到以下幾點:
雖然供應一(點)的EC2實例,我想逐步檢查(如(40%,50%,60%,70%..))如果全部失敗,則創建一個按需實例。 我該怎麼做?
我可以在這裏使用Blocks功能嗎?如果是,那麼如何?
檢查什麼增量? –
@MattSchuchard'spot_price'值 – Dawny33
你可以使用某種'async/poll/register'和/或'begin/rescue'來做到這一點嗎?我在這裏講理論。 –