2017-07-27 7 views
0

私のホストは、Linuxマシンの16.06 LTSに設定されており、ansible windows -m win_pingコマンドを使用してサーバーに正常にpingできました。AnonymousからWindowsにIISをインストールする

私のサーバーにIISをインストールしようとしています。私はinstallIIS.ymlというgroup_varsフォルダにYAMLファイルを作成しました。でYMLファイルを実行している

--- 
- name: Install IIS 
    hosts: windows 
    gather_facts: true 
    tasks: 
    - win_feature: 
    name: "windows" 
    state: present 
    restart: yes 
    include_sub_features: yes 
    include_management_tools: yes 

とイム:[email protected]:/etc/ansible# ansible-playbook group_vars/installIIS.yml

と私が受信したエラーは

ERROR! 'include_sub_features' is not a valid attribute for a Task 

The error appears to have been in '/etc/ansible/group_vars/installIIS.yml': line 6, column 6, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 

    tasks: 
    - win_feature: 
    ^here 

このに関するすべてのヘルプです。また、アンチウィルス、トリップワイヤーをインストールして、Windowsのアップデートを無事にチェックしたいと思っています。

/etc/ansible# tree 
. 
├── ansible.cfg 
├── group_vars 
│   ├── installIIS.yml 
│   ├── linux.yml 
│   └── windows.yml 
├── hosts 
└── roles 

これに関するヘルプまたはリンク。前もって感謝します。

答えて

1

win_featureのオプションを指定するインデントレベルが問題だと思います。オプションは、同じレベルではなく、win_featureモジュールの下に字下げする必要があります。

例:

--- 
- name: Install IIS 
    hosts: windows 
    gather_facts: true 
    tasks: 
    - win_feature: 
     name: "windows" 
     state: present 
     restart: yes 
     include_sub_features: yes 
     include_management_tools: yes 
関連する問題