Debian Codegraph @

ansible_collections/community/general/docs/docsite/rst/guide_online.rst

raw
1 ..
2 Copyright (c) Ansible Project
3 GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 SPDX-License-Identifier: GPL-3.0-or-later
5
6 .. _ansible_collections.community.general.docsite.guide_online:
7
8 ****************
9 Online.net Guide
10 ****************
11
12 Introduction
13 ============
14
15 Online is a French hosting company mainly known for providing bare-metal servers named Dedibox.
16 Check it out: `https://www.online.net/en <https://www.online.net/en>`_
17
18 Dynamic inventory for Online resources
19 --------------------------------------
20
21 Ansible has a dynamic inventory plugin that can list your resources.
22
23 1. Create a YAML configuration such as ``online_inventory.yml`` with this content:
24
25 .. code-block:: yaml
26
27 plugin: community.general.online
28
29 2. Set your ``ONLINE_TOKEN`` environment variable with your token.
30
31 You need to open an account and log into it before you can get a token.
32 You can find your token at the following page: `https://console.online.net/en/api/access <https://console.online.net/en/api/access>`_
33
34 3. You can test that your inventory is working by running:
35
36 .. code-block:: console
37
38 $ ansible-inventory -v -i online_inventory.yml --list
39
40
41 4. Now you can run your playbook or any other module with this inventory:
42
43 .. code-block:: ansible-output
44
45 $ ansible all -i online_inventory.yml -m ping
46 sd-96735 | SUCCESS => {
47 "changed": false,
48 "ping": "pong"
49 }