bootstrap-vz/bootstrapvz/plugins/ansible/__init__.py
Anders Ingemann 99bc43bbe9
ansible: Add task that removes the $HOME/.ansible directory on guest
If ansible_ssh_user is set through extra_vars, ansible will
create a .ansible directory in the home dir of that user.
However, it will be owned by root, which is not what ansible
will be expecting when it is provision through SSH at a later date.
2018-07-19 16:52:32 +02:00

17 lines
563 B
Python

from . import tasks
def validate_manifest(data, validator, error):
from bootstrapvz.common.tools import rel_path
validator(data, rel_path(__file__, 'manifest-schema.yml'))
def resolve_tasks(taskset, manifest):
taskset.update([tasks.AddPackages,
tasks.AddRequiredCommands,
tasks.CheckPlaybookPath,
tasks.RunAnsiblePlaybook,
])
if manifest.plugins['ansible'].get('extra_vars', {}).get('ansible_ssh_user', False):
taskset.add(tasks.RemoveAnsibleSSHUserDir)