summaryrefslogtreecommitdiffstats
path: root/doc/client/modes.txt
blob: 4cdc5496058ac2498c3cb2af7f69a83e046aa713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.. -*- mode: rst -*-

.. _client-modes:

============
Client modes
============

Dryrun mode
===========

Dryrun mode (-n) prevents the client from making changes, but gives you
some insight into the state of the machine. This mode is also useful if
you simply want to gather data from the client into the reporting
system.

Interactive mode
================

The client can be run interactively (-I) so that you are able to step
through each operation in order to see what the client is doing.

.. _client-modes-paranoid:

Paranoid mode
=============

Paranoid mode creates a backup of a local configuration file before
Bcfg2 replaces the file. This allows for easier recovery by the local
administrator.

How do I use it?
----------------

#. In the Bcfg2 repository, put `paranoid='true'` in the ``info.xml``
   file (this is the default setting).
#. On the client, create ``/var/cache/bcfg2`` (or specify an alternate
   path in the [paranoid] section of ``/etc/bcfg2.conf``).
#. On the client, run `bcfg2` with the `-P` option (alternatively, you
   can set *paranoid* to *true* in the **[client]** section of
   ``bcfg2.conf``).

This will save a copy of the replaced file in ``/var/cache/bcfg2``,
but it'll be named as the path to the file with /'s replaced
by _'s. For example, the old ``/etc/hosts`` will be named
``/var/cache/bcfg2/etc_hosts``.

Extra configuration
-------------------

.. versionadded:: 1.0.0

Here is an example of how to use some of the extra paranoid features
available. For the following section in ``bcfg2.conf`` (client-side)::

    [paranoid]
    path = /my/custom/backup/path
    max_copies = 5

You will have the file backups store in ``/my/custom/backup/path``. This
will also keep the five most recent backups of files.

Altering the global metadata to enable paranoid mode for all files
------------------------------------------------------------------

You may also want to just globally enable the *paranoid* attribute for
all files distributed to clients from your Bcfg2 server. You can
accomplish this by adding a global metadata override in your
``bcfg2.conf`` (server-side) with the following syntax::

    [mdata]
    paranoid=true

.. note:: This is the default setting.

Overall client service mode
===========================

.. versionadded:: 1.0.0

Overall client service mode. Specified on the client using ``-s <service
mode>``.

* default

  * perform all service manipulations

* disabled

  * perform no service manipulations

* build

  * attempt to stop all services started
  * deprecates/replaces -B