Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
specify rpm installed location of rho_playbook.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chambridge committed Aug 11, 2017
1 parent c6cfe97 commit 71d12f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions rho.spec
Expand Up @@ -53,9 +53,7 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/rho.1.gz
%dir %{_datadir}/ansible/%{name}
%{_datadir}/ansible/%{name}/rho_playbook.yml
%{_datadir}/ansible/%{name}/library
%{_datadir}/ansible/%{name}/library/*
%{_datadir}/ansible/%{name}/roles
%{_datadir}/ansible/%{name}/roles/*

%changelog
Expand Down
11 changes: 10 additions & 1 deletion rho/scancommand.py
Expand Up @@ -426,10 +426,19 @@ def _do_command(self):
ansible_vars = {'facts_to_collect': facts_to_collect,
'report_path': report_path}

cmd_string = ('ansible-playbook rho_playbook.yml '
playbook = utilities.PLAYBOOK_DEV_PATH
if not os.path.isfile(playbook):
playbook = utilities.PLAYBOOK_RPM_PATH
if not os.path.isfile(playbook):
print(_("rho scan playbook not found locally or in '%s'")
% playbook)
sys.exit(1)

cmd_string = ('ansible-playbook {playbook} '
'-i data/{profile}_hosts.yml -v -f {forks} '
'--ask-vault-pass '
'--extra-vars \'{vars}\'').format(
playbook=playbook,
profile=profile,
forks=forks,
vars=json.dumps(ansible_vars))
Expand Down
3 changes: 3 additions & 0 deletions rho/utilities.py
Expand Up @@ -19,6 +19,9 @@
CREDENTIALS_PATH = 'data/credentials'
PROFILES_PATH = 'data/profiles'

PLAYBOOK_DEV_PATH = 'rho_playbook.yml'
PLAYBOOK_RPM_PATH = '/usr/share/ansible/rho/rho_playbook.yml'

CONNECTION_FACTS_TUPLE = ('connection.host',
'connection.port',
'connection.uuid')
Expand Down

0 comments on commit 71d12f4

Please sign in to comment.