2016-07-31 45 views
0

我試圖用ansible創建AWS室壁運動流,我得到了一些例子模塊片段從here無法使用可靠的模塊創建aws kinesis流...!

我修改的摘錄kinesis.yml就是在這裏創造室壁運動在特定區域流:

- hosts: localhost 
    connection: local 
    gather_facts: no 
    vars: 
#aws region to create kinesis 
    region: ap-south-1 
    tasks: 
    - name: Set up Kinesis Stream with 2 shards and wait for the stream to become ACTIVE 
     kinesis_stream: 
       name: test-stream 
       shards: 2 
       wait: yes 
       wait_timeout: 600 
       region: "{{ region }}" 
     register: test_stream 

我想有些地方我messud了的方式,我們可以定義室壁運動模塊,我得到了下面的錯誤:

centos]# ansible-playbook -vvvv kinesis.yml 
    No config file found; using defaults 
    ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path. 

    The error appears to have been in '/home/centos/kinesis.yml': line 4, column 7, but may 
    be elsewhere in the file depending on the exact syntax problem. 

    The offending line appears to be: 

     tasks: 
     - name: Set up Kinesis Stream with 2 shards and wait for the stream to become ACTIVE 
     ^here 

我與博託配置我的AWS控制檯訪問鍵。 請讓我知道是否有一個正確的方法來定義完善的劇本,在特定的aws區域創建一個kinesis。?

回答

-1

最後我通過使用aws cli和ansible來實現。多一點探索才行,它也支持命令行選項。所以,我們可以傳遞與合理的工作相關的aws cli命令。

這裏是我的示例模塊的代碼片段:

--- 
- hosts: localhost 
    connection: local 
    gather_facts: no 
    vars: 
    streamName: test-stream 
    shardCount: 2 
    tasks: 
    - name: Create Kinesis Sream 
     command: aws kinesis create-stream --stream-name {{streamName}} --shard-count {{shardCount}} 
     register: kinesis 

使用這種AWS CLI方法,我們可以快速地爲我們Ansible劇本添加更多的功能AWS /服務。

1

kinesis_stream處於尚未包含的拉取請求中。這意味着它不是Ansible的一部分。一個模塊或修訂版實際上在Ansible中出貨通常需要很長時間(他們相當開發不友好)。

要使用該模塊,您需要將它放在本地library/文件夾中。

+0

從哪裏獲得該圖書館。如果您有任何參考鏈接,請分享。謝謝 –

+0

[這是](https://github.com/ansible/ansible-modules-extras/pull/1901)。如果沒有更高水平的Ansible專業知識,你可能不應該使用它。 – tedder42

+0

是的,我正在探索。希望我能在未來幾天內實現! :)謝謝 –