Playbooks
Playbooks are used in Pigsty to install modules on nodes.To run playbooks, just treat them as executables.
e.g. run with .
Here are default playbooks included in Pigsty.
One-Pass Install
The special playbook install.yml
is actually a composed playbook that install everything on current environment.
Note that there’s a circular dependency between NODE and : to register a NODE to INFRA, the INFRA should already exist, while the INFRA module relies on NODE to work.
The solution is that INFRA
playbook will also install NODE module in addition to on infra nodes. Make sure that infra nodes are init first.
Pigsty will install ansible on admin node during .
You can install it by yourself with or brew install ansible
, it is included in default OS repo.
Knowledge about ansible is good but not required. Only three parameters needs your attention:
-t|--tags <tags>
: Only run tasks with specific tags (What)-e|--extra-vars <vars>
: Extra command line arguments (How)
The target of playbook can be limited with .
Missing this value could be dangerous since most playbooks will execute on all
host, DO USE WITH CAUTION.
Here are some examples of host limit:
You can execute a subset of playbook with -t|--tags <tags>
.
If specified, tasks with given tags will be executed instead of entire playbook.
Here are some examples of task limit:
Extra command-line args can be passing via -e|-extra-vars KEY=VALUE
.
It has the highest precedence over all other definition.
Here are some examples of extra vars
Most playbooks are idempotent, meaning that some deployment playbooks may erase existing databases and create new ones without the protection option turned on.
Please read the documentation carefully, proofread the commands several times, and operate with caution. The author is not responsible for any loss of databases due to misuse.