2017-01-03 71 views
1

我使用Ansible 2.2.0以提供Ubuntu的16.04服務器,但它一直在那裏步我adding a new apt repository失敗:添加PPA使用Ansible失敗

fatal: [the.server.ip.address]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_pctla3gj/ansible_module_apt_repository.py\", line 528, in <module>\r\n main()\r\n File \"/tmp/ansible_pctla3gj/ansible_module_apt_repository.py\", line 492, in main\r\n sourceslist.add_source(repo)\r\n File \"/tmp/ansible_pctla3gj/ansible_module_apt_repository.py\", line 403, in add_source\r\n info = self._get_ppa_info(ppa_owner, ppa_name)\r\n File \"/tmp/ansible_pctla3gj/ansible_module_apt_repository.py\", line 377, in _get_ppa_info\r\n return json.load(response)\r\n File \"/usr/lib/python3.5/json/__init__.py\", line 268, in load\r\n parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)\r\n File \"/usr/lib/python3.5/json/__init__.py\", line 312, in loads\r\n s.__class__.__name__))\r\nTypeError: the JSON object must be str, not 'bytes'\r\n", "msg": "MODULE FAILURE"} 

在我有以下我劇本:

- name: add the ffmpeg PPA 
    apt_repository: 
    repo: 'ppa:jonathonf/ffmpeg-3' 

該文檔似乎很簡單,所以我不知道這個問題是在這裏。我嘗試手動添加它(sudo add-apt-repository ppa:jonathonf/ffmpeg-3),它工作得很好。

+0

可能重複[如何使用Ansible添加PPA存儲庫?](http://stackoverflow.com/questions/29319752/how-can-i-add-a-ppa-repository-using-ansible) –

回答

0

找到this answer其中有一個不同的錯誤,但答案的工作;將become: yes添加到該任務,它將工作。