Skip to content

jerryoman/phpMyAnsibleAdmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpMyAnsibleInventory

A PHP based web interface an manage your Ansible inventory in a MySQL database and an inventory script to make use of it within Ansible. Also allows for submitting of Ansible tasks from within the UI (feature still under development).

Requirements

Nothing fancy is needed other than a normal, relatively up to date PHP & MySQL environment. The UI is based on CodeIgniter 3 so PHP 5.6 is required.

UI Installation

  • Clone/download the repo. Configure the public/ folder to be the web root.
  • Change the system & application path variables ($system_path, $application_folder) in public/index.php if desired.
  • Create a MySQL database for the application and optionally a user/password for the application.
  • Copy/move application/config/database.php.sample to database.php and modify with your database details.
  • Copy/move application/config/config.php.sample to config.php and set $config['base_url'].
  • Change application/config/custom.php as desired (not much there yet).
  • Load the included sql/install.sql file to seed the database with a minimal dataset.
  • The default account is:

Ansible inventory script installation

Assuming an ansible project with an "inventory" folder. Copy the scripts/mysql.php file into the inventory folder. Then add the following to an ansible.cfg in your project:

[defaults]
inventory = ./inventory

Or, if you'd prefer you can spefify the location when you invoke ansible commands. For example:

ansible-playbook myplaybook.com -i ./inventory/mysql.php

Running of Ansible tasks from within the UI

This feature is still under development, and while generally functional still needs to be made friendlier. To support tasks do the following.

In application/config/custom.php:

$config['tasks_on'] = true;
$config['tasks_log_path'] = '/tmp/tasks';
$config['ansible_project_path'] = '/var/www/phpMyAnsibleAdmin/ansible';

Schedule the task runner in cron. This should be run by the owner that you use to run your ansible commands from CLI. For example, to check for new tasks every minute:

* * * * * /usr/local/bin/php /var/www/phpMyAnsibleAdmin/public/index.php cron/tasks processAnsibleQueue > /dev/null 2>&1

Screenshots

1login

2home

3servers

4edit_server

5groups

6edit_group

7submit_task

8task_details2

Credits

To give credit where credit is due the following tools made this easily possible.

Copyright (C) 2017 KISS IT Consulting, LLC. All rights reserved.

About

PHP Based Web Interface and Inventory script for Ansible

Resources

License

BSD-2-Clause, MIT licenses found

Licenses found

BSD-2-Clause
LICENSE
MIT
Codeigniter-license.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •