diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-12-19 10:58:46 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-01-09 10:19:52 +0100 |
commit | a12fb1f94171e61b0c93f2dbfaa5b171087f2a52 (patch) | |
tree | 06fc26ce75e00570768af0fdbe6aa12f0290117f /facts.py | |
parent | 71b0af36775ae0e15935c6a5774011ed1a47ca5d (diff) | |
download | clufter-a12fb1f94171e61b0c93f2dbfaa5b171087f2a52.tar.gz clufter-a12fb1f94171e61b0c93f2dbfaa5b171087f2a52.tar.xz clufter-a12fb1f94171e61b0c93f2dbfaa5b171087f2a52.zip |
facts: add ability to translate logical cmd to distro cmd
The target distro cmd is expected to keep the assumed template form
(say, a command to install packages should contain "{commands}" field
that is then substituted, via "format" method, with the desired
packages, completing the command to be used further in the process).
Unlike with logical packages, nothing is considered a (suitable)
distro-wide default.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'facts.py')
-rw-r--r-- | facts.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -54,6 +54,8 @@ cluster_map = { 'pacemaker[cman]': (1, 1, 4), #--- 'pkg::mysql': 'mysql-server', + #--- + 'cmd::pkg-install': 'yum install -y {packages}', }), ((14, ), { 'corosync': (1, 4), @@ -84,6 +86,8 @@ cluster_map = { 'pkg::mysql': 'mysql-server', 'pkg::postgresql': 'postgresql-server', 'pkg::virsh': 'libvirt-client', + #--- + 'cmd::pkg-install': 'yum install -y {packages}', }), ((6, 2), { 'corosync': (1, 4), @@ -374,6 +378,13 @@ def package(which, *sys_id): return _find_meta('pkg', which, *sys_id, default=which) +def cmd_pkg_install(pkgs, *sys_id): + cmd = _find_meta('cmd', 'pkg-install', *sys_id) + if cmd: + cmd = cmd.format(packages=' '.join(pkgs)) + return cmd + + cluster_systems = (cluster_pcs_flatiron, cluster_pcs_needle) |