andywimmer / ansible-grav

Ansible playbook to install NGINX, PHP7-FPM and Grav CMS
MIT License
13 stars 3 forks source link

Consecutive Playbook Runs - pecl yaml-2.0.0 Install Error #8

Open 5car1z opened 6 years ago

5car1z commented 6 years ago

Thanks for the playbook. I adopted some of the tasks in one of my own and it's been working great.

The only problem I ran into was Ansible returned an error upon consecutive runs of the playbook, on the same host. The error took place when it comes to installing the YAML parser via pecl task.

- name: PHP - Install YAML parser
  become: true
  shell: pecl install yaml-2.0.0

Not that I've checked but I'm assuming this is the same in the other OS specific role equivalents too (mine was the Debian one).

The error message (which unfortunately I no longer have to hand) was basically complaining that yaml-2.0.0 is already present and up to date on the system; this exited and ended the playbook operations.

So I fixed it by using the pear module instead of shell - like this:

- name: PHP - Install YAML parser
  become: true
  pear:
    name: pecl/yaml-2.0.0
    state: present

Figured you might be interested in this? So as to keep it idempotent and such. Was also considering making a PR but you said in the README you prefer to test and investigate yourself.

Hope this makes sense and is of use to you, thanks again for the playbook.

andywimmer commented 6 years ago

Thanks for raising this issue and also reading the README and not blindly submitting a PR for it.

Unfortunately I doubt I'll be able to address this bug in 2017 as I'm completely swamped with other things now.

I'm open to PRs but can't always merge them in as quickly as some would like. I really hate bugs though! So trust it will be addressed as soon as I have some time to devote to it.

5car1z commented 6 years ago

Not to worry that's okay. It's not too severe a problem, only occurs on subsequent playbook runs as mentioned.

For what it's worth my remote hosts were DigitalOcean droplets running Debian Stretch 9.2 x64.

:+1: