Merge "Moved library to solar/ansible_library"
This commit is contained in:
commit
8ef52f1dbc
@ -16,6 +16,9 @@ classifier =
|
||||
keywords =
|
||||
deployment
|
||||
|
||||
[files]
|
||||
package-data = solar = ansible_library/*.py
|
||||
|
||||
[build_sphinx]
|
||||
all_files = 1
|
||||
build-dir = doc/build
|
||||
|
@ -16,6 +16,7 @@
|
||||
from fabric.state import env
|
||||
import os
|
||||
|
||||
from pkg_resources import resource_filename
|
||||
from solar.core.handlers.base import SOLAR_TEMP_LOCAL_LOCATION
|
||||
from solar.core.handlers.base import TempFileHandler
|
||||
from solar.core.log import log
|
||||
@ -48,6 +49,9 @@ class AnsibleTemplateBase(TempFileHandler):
|
||||
def _create_playbook(self, resource, action):
|
||||
return self._compile_action_file(resource, action)
|
||||
|
||||
def get_library_path(self):
|
||||
return resource_filename('solar', 'ansible_library')
|
||||
|
||||
|
||||
# if we would have something like solar_agent that would render this then
|
||||
# we would not need to render it there
|
||||
@ -63,7 +67,7 @@ class AnsibleTemplate(AnsibleTemplateBase):
|
||||
|
||||
self._copy_templates_and_scripts(resource, action_name)
|
||||
self.transport_sync.copy(resource, self.dst, '/tmp')
|
||||
self.transport_sync.copy(resource, '/vagrant/library', '/tmp')
|
||||
self.transport_sync.copy(resource, self.get_library_path(), '/tmp')
|
||||
self.transport_sync.sync_all()
|
||||
|
||||
# remote paths are not nested inside solar_local
|
||||
|
@ -57,7 +57,8 @@ class AnsibleTemplateLocal(AnsibleTemplateBase):
|
||||
log.debug('inventory_file: %s', inventory_file)
|
||||
log.debug('playbook_file: %s', playbook_file)
|
||||
|
||||
call_args = ['ansible-playbook', '--module-path', '/tmp/library',
|
||||
lib_path = self.get_library_path()
|
||||
call_args = ['ansible-playbook', '--module-path', lib_path,
|
||||
'-i', inventory_file, playbook_file]
|
||||
log.debug('EXECUTING: %s', ' '.join(call_args))
|
||||
|
||||
|
2
tox.ini
2
tox.ini
@ -71,7 +71,7 @@ usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H101,H236,E731,H405
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs,solar/ansible_library
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
count = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user