mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
ansible: Check for ansible availability before running
This commit is contained in:
parent
ad6c89cb41
commit
ff48243c6e
2 changed files with 15 additions and 3 deletions
|
@ -7,6 +7,8 @@ def validate_manifest(data, validator, error):
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
taskset.add(tasks.AddPackages)
|
taskset.update([tasks.AddPackages,
|
||||||
taskset.add(tasks.CheckPlaybookPath)
|
tasks.AddRequiredCommands,
|
||||||
taskset.add(tasks.RunAnsiblePlaybook)
|
tasks.CheckPlaybookPath,
|
||||||
|
tasks.RunAnsiblePlaybook,
|
||||||
|
])
|
||||||
|
|
|
@ -1,9 +1,19 @@
|
||||||
from bootstrapvz.base import Task
|
from bootstrapvz.base import Task
|
||||||
|
from bootstrapvz.common.tasks import host
|
||||||
from bootstrapvz.common import phases
|
from bootstrapvz.common import phases
|
||||||
from bootstrapvz.common.tools import rel_path
|
from bootstrapvz.common.tools import rel_path
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
class AddRequiredCommands(Task):
|
||||||
|
description = 'Adding commands required for provisioning with ansible'
|
||||||
|
phase = phases.validation
|
||||||
|
successors = [host.CheckExternalCommands]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
info.host_dependencies['ansible'] = 'ansible'
|
||||||
|
|
||||||
class CheckPlaybookPath(Task):
|
class CheckPlaybookPath(Task):
|
||||||
description = 'Checking whether the playbook path exist'
|
description = 'Checking whether the playbook path exist'
|
||||||
phase = phases.validation
|
phase = phases.validation
|
||||||
|
|
Loading…
Add table
Reference in a new issue