Add module_path as option for ansible-playbook action

Add the ability to set the --module-path option for
Ansible playbook.
In the minor update case, we need to point the module
path to the /usr/share/ansible-modules, where the
ansible-pacemaker module are installed

Change-Id: Iba8e76cbcb558d5dc2da93f174bbb9fb3d3b39a6
This commit is contained in:
Mathieu Bultel
2017-10-06 15:15:34 +02:00
parent c82bf420dc
commit 214bf63808
2 changed files with 7 additions and 1 deletions

View File

@@ -221,6 +221,7 @@ class AnsiblePlaybookAction(actions.Action):
self._kwargs_for_run = kwargs
self._playbook = self._kwargs_for_run.pop('playbook', None)
self.limit_hosts = self._kwargs_for_run.pop('limit_hosts', None)
self.module_path = self._kwargs_for_run.pop('module_path', None)
self.remote_user = self._kwargs_for_run.pop('remote_user', None)
self.become = self._kwargs_for_run.pop('become', None)
self.become_user = self._kwargs_for_run.pop('become_user', None)
@@ -342,6 +343,9 @@ class AnsiblePlaybookAction(actions.Action):
if self.limit_hosts:
command.extend(['--limit', self.limit_hosts])
if self.module_path:
command.extend(['--module-path', self.module_path])
if self.remote_user:
command.extend(['--user', self.remote_user])

View File

@@ -71,6 +71,7 @@ workflows:
- playbook
- inventory_file
- queue_name: tripleo
- module_path: /usr/share/ansible-modules
tags:
- tripleo-common-managed
@@ -100,7 +101,8 @@ workflows:
verbosity: 0
ssh_private_key: <% $.private_key %>
ssh_extra_args: '-o StrictHostKeyChecking=no'
limit_hosts: <% $.nodes %>
limit_hosts: <% $.nodes %>
module_path: <% $.module_path %>
on-success: node_update_passed
on-error: node_update_failed
publish: