Vagrant+Ansible Not working main.yum

Not working main.yum

`

  • name: add php ppa
    apt_repository: repo=‘ppa:ondrej/php’ state=present

  • name: update apt cache
    apt: update_cache=yes

`

vagrant up

`
TASK [php : add php ppa] *******************************************************
fatal: [joomla]: FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “Shared connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “Traceback (most recent call last):\r\n File "/tmp/ansible_cdHTo1/ansible_module_apt_repository.py", line 556, in \r\n main()\r\n File "/tmp/ansible_cdHTo1/ansible_module_apt_repository.py", line 544, in main\r\n cache.update()\r\n File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 443, in update\r\n raise FetchFailedException(e)\r\napt.cache.FetchFailedException: W:Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found\r\n, E:Some index files failed to download. They have been ignored, or old ones used instead.\r\n”, “msg”: “MODULE FAILURE”, “rc”: 0}
to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/playbook.retry

PLAY RECAP *********************************************************************
joomla : ok=4 changed=2 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

`

It says "Not Found", ppa.launchpad.net is for Ubuntu, not Debian Jessie.

I installed it, but it does not help.

http://docs.ansible.com/ansible/latest/intro_installation.html

`

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

`

I installed it, but it does not help.

http://docs.ansible.com/ansible/latest/intro_installation.html

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

My comment was not about Ansible.

I commented on this:

    raise FetchFailedException(e)\r\napt.cache.FetchFailedException:
W:Failed to fetch
http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jessie/main/binary-amd64/Packages
  404 Not Found\r\n, E:Some index files failed to download. They have been

It says "Not Found", ppa.launchpad.net is for Ubuntu, not Debian Jessie.

It says
"http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found"

That mean that the repository ppa:ondrej/php doesn't exist.
If you look closer to that link you see the following.
"/jessie/"

Jessie is Debian Linux, but ppa on ppa.launchpad.net is for Ubuntu Linux, Ubuntu is not the same as Debian, so you can't use Ubuntu Linux repository on a Debian Linux, at lest not the ppa:ondrej/php.

I do not understand how to fix the problem …

You got 3 choices:

1. Use the php that comes with Debian
2. If that's not an alternative, you need to find a repository for Debian that have the php you need.
3. Or change your Vagrant VM to run Ubuntu instead of Debian

You are right! It work with Ubuntu.
But, I need item two. I want to install virtual pc with Ubuntu and Debian.

Where should I register the repository for debian (My Ubuntu 16.04)?