Skip to content

Instantly share code, notes, and snippets.

@yauh
Created January 24, 2014 11:15
Show Gist options
  • Save yauh/8595566 to your computer and use it in GitHub Desktop.
Save yauh/8595566 to your computer and use it in GitHub Desktop.
pear installation via ansible
- name: PEAR installing modules
command: pear install {{ item }}
register: pear_result
with_items:
- pear.netpirates.net/phpDox
- pear.symfony.com/Yaml
- pear.phpmd.org/PHP_PMD
changed_when: pear_result.stdout.find("already installed") == -1
results in errors like this:
failed: [127.0.0.1] => (item=pear.netpirates.net/phpDox) => {"changed": false, "cmd": ["pear", "install", "pear.netpirates.net/phpDox"], "delta": "0:00:00.060846", "end": "2014-01-24 06:13:59.860506", "item": "pear.netpirates.net/phpDox", "rc": 1, "start": "2014-01-24 06:13:59.799660", "stdout_lines": ["theseer/phpDox is already installed and is the same as the released version 0.6.3", "install failed"]}
stdout: theseer/phpDox is already installed and is the same as the released version 0.6.3
install failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment