如何使用ansible检查aws队列是否存在



如果不存在,如何使用可执行的剧本创建aws-sqs队列?

我不知道如何使用ansible 进行检查

如果您正在检查sqs_queue(比方说(,下面的代码片段可能有助于

- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: create queue if needed
sqs_queue:
name: "test_queue"
state: "present"
region: "us-east-1"

如果该任务不存在,则会创建一个队列。您应该在输出中看到changed

如果它存在,则它将报告ok,这意味着当前状态已经与所需状态匹配。

您可以在官方文档sqs队列ansible 中获得更多信息

最新更新