summaryrefslogtreecommitdiffstats
path: root/doc/mgr/ansible.rst
blob: e81e67baf306520b1b80e9ebfb37f3234fd0dc7f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.. _ansible-module:

====================
Ansible Orchestrator
====================

This module is a :ref:`Ceph orchestrator <orchestrator-modules>` module that uses `Ansible Runner Service <https://github.com/pcuzner/ansible-runner-service>`_ (a RESTful API server) to execute Ansible playbooks in order to satisfy the different operations supported.

These operations basically (and for the moment) are:

- Get an inventory of the Ceph cluster nodes and all the storage devices present in each node
- ...
- ...


Usage
=====

Enable the module:

::

    # ceph mgr module enable ansible

Disable the module

::

    # ceph mgr module disable ansible


Enable the Ansible orchestrator module and use it with the :ref:`CLI <orchestrator-cli-module>`:

::

    ceph mgr module enable ansible
    ceph orchestrator set backend ansible


Configuration
=============

Configuration must be set once the module is enabled by first time.

This can be done in one monitor node via the configuration key facility on a
cluster-wide level (so they apply to all manager instances) as follows::


    # ceph config set mgr mgr/ansible/server_addr <ip_address/server_name>
    # ceph config set mgr mgr/ansible/server_port <port>
    # ceph config set mgr mgr/ansible/username <username>
    # ceph config set mgr mgr/ansible/password <password>
    # ceph config set mgr mgr/ansible/verify_server <verify_server_value>

Where:

    * <ip_address/server_name>: Is the ip address/hostname of the server where the Ansible Runner Service is available.
    * <port>: The port number where the Ansible Runner Service is listening
    * <username>: The username of one authorized user in the Ansible Runner Service
    * <password>: The password of the authorized user.
    * <verify_server_value>: Either a boolean, in which case it controls whether the server's TLS certificate is verified, or a string, in which case it must be a path to a CA bundle to use in the verification. Defaults to ``True``.


Debugging
=========

Any kind of incident with this orchestrator module can be debugged using the Ceph manager logs:

Set the right log level in order to debug properly. Remember that the python log levels debug, info, warn, err are mapped into the Ceph severities 20, 4, 1 and 0 respectively.

And use the "active" manager node: ( "ceph -s" command in one monitor give you this information)

* Check current debug level::

    [@mgr0 ~]# ceph daemon mgr.mgr0 config show | grep debug_mgr
    "debug_mgr": "1/5",
    "debug_mgrc": "1/5",

* Change the log level to "debug"::

    [mgr0 ~]# ceph daemon mgr.mgr0 config set debug_mgr 20/5
    {
        "success": ""
    }

* Restore "info" log level::

    [mgr0 ~]# ceph daemon mgr.mgr0 config set debug_mgr 1/5
    {
        "success": ""
    }


Operations
==========

**Inventory:**

Get the list of storage devices installed in all the cluster nodes. The output format is::

  [host:
     device_name (type_of_device , size_in_bytes)]

Example::

  [root@mon0 ~]# ceph orchestrator device ls
  192.168.121.160:
    vda (hdd, 44023414784b)
    sda (hdd, 53687091200b)
    sdb (hdd, 53687091200b)
    sdc (hdd, 53687091200b)
  192.168.121.36:
    vda (hdd, 44023414784b)
  192.168.121.201:
    vda (hdd, 44023414784b)
  192.168.121.70:
    vda (hdd, 44023414784b)
    sda (hdd, 53687091200b)
    sdb (hdd, 53687091200b)
    sdc (hdd, 53687091200b)