2016-04-30 30 views
0

我第一次嘗試使用Ansible。當我試圖運行一個劇本,我得到這個錯誤:錯誤!這個任務'apt_repository'有額外的參數

ERROR! this task 'apt_repository' has extra params, which is only allowed in the following modules: command, shell, script, include, include_vars, add_host, group_by, set_fact, raw, meta 

The error appears to have been in '/home/prism/Desktop/ansible/basic_package/main.yml': line 9, column 5, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 


    - name: "Add Webupd8 ppa for youtube-dl" 
    ^here 

main.yml:

--- 
- hosts: all 
    remote_user: root 

    tasks: 
    - name: "Upgrade the whole system" 
    apt: upgrade=dist update_cache=yes 

    - name: "Add Webupd8 ppa for youtube-dl" 
    apt_repository: repo ='ppa:nilarimogard/webupd8' 

    - name: "Install basic package" 
    apt: name={{ item }} state=installed 
    with_items: 
     - libffi-dev 
     - vnstat 
     - youtube-dl 
     - finger 
     - htop 
     - python3-dev 
     - axel 
     - curl 
     - fail2ban 
     - python-dev 
     - sendmail 
     - git 
     - python-software-properties 
     - software-properties-common 
     - python-pip 
     - nethogs 
     - unzip 
     - nmap 

回答

4

看起來你在apt_repository任務回購參數後的額外空間。使用以下代碼:

apt_repository: repo='ppa:nilarimogard/webupd8' 
相關問題