source: rattail-fabric2/rattail_fabric2/rattail.py @ e8769c8

Last change on this file since e8769c8 was e8769c8, checked in by Lance Edgar <lance@…>, 12 months ago

Initial commit; enough to prove concepts at least

was able to bootstrap a complete machine with this, although there's lots
missing yet...

  • Property mode set to 100644
File size: 2.2 KB
Line 
1# -*- coding: utf-8; -*-
2################################################################################
3#
4#  Rattail -- Retail Software Framework
5#  Copyright © 2010-2018 Lance Edgar
6#
7#  This file is part of Rattail.
8#
9#  Rattail is free software: you can redistribute it and/or modify it under the
10#  terms of the GNU General Public License as published by the Free Software
11#  Foundation, either version 3 of the License, or (at your option) any later
12#  version.
13#
14#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
15#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17#  details.
18#
19#  You should have received a copy of the GNU General Public License along with
20#  Rattail.  If not, see <http://www.gnu.org/licenses/>.
21#
22################################################################################
23"""
24Fabric library for Rattail itself
25"""
26
27from __future__ import unicode_literals, absolute_import
28
29import os
30
31from rattail_fabric2 import make_deploy, make_system_user, mkdir
32
33
34deploy = make_deploy(__file__)
35
36
37def bootstrap_rattail(c, home='/var/lib/rattail', uid=None, shell='/bin/bash'):
38    """
39    Bootstrap a basic Rattail software environment.
40    """
41    make_system_user(c, 'rattail', home=home, uid=uid, shell=shell)
42    mkdir(c, os.path.join(home, '.ssh'), owner='rattail:', mode='0700', use_sudo=True)
43
44    mkdir(c, '/etc/rattail', use_sudo=True)
45    mkdir(c, '/srv/rattail', use_sudo=True)
46    mkdir(c, '/var/log/rattail', owner='rattail:rattail', mode='0775', use_sudo=True)
47
48    mkdir(c, '/srv/rattail/init', use_sudo=True)
49    deploy(c, 'daemon', '/srv/rattail/init/daemon', use_sudo=True)
50    deploy(c, 'check-rattail-daemon', '/usr/local/bin/check-rattail-daemon', use_sudo=True)
51    deploy(c, 'luigid', '/srv/rattail/init/luigid', use_sudo=True)
52    deploy(c, 'soffice', '/srv/rattail/init/soffice', use_sudo=True)
53    # TODO: deprecate / remove these
54    deploy(c, 'bouncer', '/srv/rattail/init/bouncer', use_sudo=True)
55    deploy(c, 'datasync', '/srv/rattail/init/datasync', use_sudo=True)
56    deploy(c, 'filemon', '/srv/rattail/init/filemon', use_sudo=True)
Note: See TracBrowser for help on using the repository browser.