PHPackages                             lucbu/ansible-wrapper-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. lucbu/ansible-wrapper-bundle

ActiveProject[DevOps &amp; Deployment](/categories/devops)

lucbu/ansible-wrapper-bundle
============================

A Symfony wrapper for Ansible, providing launcher, events...

210PHP

Since Nov 17Pushed 9y ago2 watchersCompare

[ Source](https://github.com/lucbu/AnsibleWrapperBundle)[ Packagist](https://packagist.org/packages/lucbu/ansible-wrapper-bundle)[ RSS](/packages/lucbu-ansible-wrapper-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Ansible Wrapper Bundle
======================

[](#ansible-wrapper-bundle)

Introduction
------------

[](#introduction)

This bundle provide a Wrapper and tools for Ansible 2.

It can configurate and execute the commands (ansible, ansible-playbook), fire event, reformat error message.

I'm not an expert, so, please feel free to send pull requests.

Prerequisite
------------

[](#prerequisite)

- Ansible 2 (Installation tutorial [here](http://docs.ansible.com/ansible/intro_installation.html))
- Symfony 2.8 ()
- sudo (=&gt; Unix I guess)

\##Installation

Install it with :

```
composer require lucbu/ansible-wrapper-bundle

```

Add the bundle to kernel :

```
new Lucbu\AnsibleWrapperBundle\LucbuAnsibleWrapperBundle(),

```

You can create a user that will be used to launch ansible/ansible-playbook command.

```
useradd ansible-launcher

```

Then add the right for your http user to launch command with the user below using visudo (in the sudoers file):

```
www-data ALL=(ansible-launcher) NOPASSWD: /usr/local/bin/ansible
www-data ALL=(ansible-launcher) NOPASSWD: /usr/local/bin/ansible-playbook

```

You should add this line in ansible.cfg behind "\[defaults\]"

```
stdout_callback = json

```

Add this in your configuration (config.yml):

```
lucbu_ansible_wrapper:
  ansible:
    user: 'ansible-launcher'    #The user that will launch ansible command
    dir: '/usr/local/bin'       #The folder where is located 'ansible'
  ansible_playbook:
    user: 'ansible-launcher'    #The user that will launch ansible-playbook command
    dir: '/usr/local/bin'       #The folder where is located 'ansible-playbook'

```

Use
---

[](#use)

Playbook File (/tmp/ansible/addfile.yml):

```
-
    hosts: all
    tasks:
      - file: path=/tmp/{{ filename }} state=touch mode="u=rw,g=r,o=r"

```

In the controller:

```
$playbookFile = '/tmp/ansible/addfile.yml';
$vars = ['filename'=>'test'];
$hostFile = '/tmp/hostfile.yml';

$process = AnsiblePlaybookProcessBuilder::createBuilder($playbookFile)
  // Add the vars to command
  ->extraVars($vars)
  // Set the InventoryFile
  ->inventoryFile($hostFile)
  // SSH connecting with user "root"
  ->user('root')
  // Create the process
  ->getAnsiblePlaybookProcess();

$cmd_line = $process->getProcess()->getCommandLine();

try {
    // Executing code (and firing start/new output/finish events)
    $output = $this->container->get('lucbu_ansible_wrapper.ansible_playbook_process_executor')->executeAnsiblePlaybookProcess($process);
} catch (\Exception $e) {
    $output = $e->getMessage();
}

```

TODO
----

[](#todo)

- Reformat error message (AnsibleMessageFormatter) (to an object?)
- Clean the AbstractProcessExecutor?

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5434555?v=4)[lucbu](/maintainers/lucbu)[@lucbu](https://github.com/lucbu)

---

Top Contributors

[![lucbu](https://avatars.githubusercontent.com/u/5434555?v=4)](https://github.com/lucbu "lucbu (1 commits)")

### Embed Badge

![Health badge](/badges/lucbu-ansible-wrapper-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/lucbu-ansible-wrapper-bundle/health.svg)](https://phpackages.com/packages/lucbu-ansible-wrapper-bundle)
```

###  Alternatives

[ryoluo/sail-ssl

Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.

192739.0k3](/packages/ryoluo-sail-ssl)[sarfraznawaz2005/servermonitor

Laravel package to periodically monitor the health of your server and website.

19613.5k1](/packages/sarfraznawaz2005-servermonitor)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4676.9k](/packages/tiamo-phpas2)[wapmorgan/php-rpm-packager

RPM packager for PHP applications.

116.5k](/packages/wapmorgan-php-rpm-packager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
