-
Notifications
You must be signed in to change notification settings - Fork 0
AnsiblePlaybookConfigFormat
In order to use an Ansible playbook, you must
- Configure
ansible_dir
parameter in the config file: set it to your location of Ansible playbooks (default: ``./ansible`) - Configure
ansible_logs
parameter in the config file: set it to your desired location of Ansible playbooks execution logs (default:./ansible_logs
). You can view stdout output there - Generate a SSH key for Ansible if not done before. If you use VMEmperor auto-installation, this key will be authorized in a VM
- Specify pubkey location in
ansible_pubkey
parameter in a config file - (Optional) Set
ansible_playbook
parameter to the path toansible-playbook
binary if you use custom Ansible distribution
After that, put your Ansible playbooks in your ansible_dir
location, one playbook per one subdirectory.
In each of Ansible playbook subdirectories you should create a file in YAML format named vmemperor.conf
. An example is provided in VMEmperor distribution, directory ansible/wordpress-nginx
All parameters are not optional unless explicitly specified
Human-readable playbook name
Humnan-readable playbook description
Path to playbook file (to run with ansible-playbook
) relatively to current directory
Path to inventory file. If this option is specified, the playbook is only seen to administrators and operates on hosts specified in this inventory file. If not specified, the playbook is available for everyone and operates on hosts selected by user in user interface (i.e. hosts file is generated automatically)
Not stable - not defined yet
Specification of variables that are supposed to be overrided by user
Variable names taken from host_vars/all
and group_vars/all
Each value is a dictionary with the following keys:
- description - human-readable variable description
- type - variable type (see below)
-
str
- string -
int
- number -
bool
- check box -
option
- list of choices
For type option
there is one more dictionary key expected: options
. Its value is a dictionary with all possible options as keys and dictionaries as values
Each value in options
dictionary is a dictionary with a key named description
and value providing human readable description for its option
---
name: WordPress
description: WordPress CentOS Setup
playbook: site.yml
inventory: hosts
requires:
os_version:
- distro: centos
major: 6
- distro: redhat
variables:
wp_version:
description: WordPress version
type: str
wp_sha256sum:
description: WordPress release SHA256
type: str
mysql_port:
description: MySQL port
type: int
server_hostname:
description: WordPress server hostname
type: str
auto_up_disable:
description: Disable automatic updates
type: bool
core_update_level:
description: Core Update Level
type: option
options:
true:
description: Development, minor, and major updates are all enabled
false:
description: Development, minor, and major updates are all disabled
minor:
description: Minor updates are enabled, development, and major updates are disabled