1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
Simon Deziel c7150dd818
plugins/connection/lxd: convert FQDN to instance name (#7360)
* plugins/connection/lxd: convert FQDN to instance name

This allows to use FQDNs in the inventory and have the
connection driver do the translation when talking to
LXD that uses hostnames (no ".") for instance names.
Those are either globally unique or unique per network/
project in LXD.

```
all:
  # Groups and hosts
  children:
    lxd_dmz:
      vars:
        ansible_lxd_project: dmz
      hosts:
        www01.dmz.example.com:
        www02.dmz.example.com:
```

```
$ lxc list --project dmz
+---------+---------+----------------+------+-----------+-----------+----------+
|  NAME |  STATE  |        IPV4      | IPV6 |   TYPE    | SNAPSHOTS | LOCATION |
+-------+---------+------------------+------+-----------+-----------+----------+
| www01 | RUNNING | 192.0.2.1 (eth0) |      | CONTAINER | 0         | t1       |
+-------+---------+------------------+------+-----------+-----------+----------+
| www02 | RUNNING | 192.0.2.2 (eth0) |      | CONTAINER | 0         | t3       |
+-------+---------+------------------+------+-----------+-----------+----------+
```

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/connection/lxd: VMs/containers are called instances

Update error string parsing to support the new format:

  $ lxc stop c1 -- true
  $ lxc exec c1 -- true
  Error: Instance is not running

  $ lxc exec does-not-exist -- true
  Error: Instance not found

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

* plugins/connection/lxd: add changelog fragment

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>

---------

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2023-10-25 08:47:27 +02:00
..
action freebsd: shutdown -p ... on freebsd to power off machine (#7102) 2023-08-14 19:41:47 +02:00
become machinectl become plugin: mark as require_tty (#6935) 2023-07-15 12:53:59 +02:00
cache Start using semantic markup (#6627) 2023-06-10 09:28:40 +02:00
callback Fix callback/selective task print being long (#7374) 2023-10-11 16:20:30 +02:00
connection plugins/connection/lxd: convert FQDN to instance name (#7360) 2023-10-25 08:47:27 +02:00
doc_fragments proxmox module utils: better error msg when token fails with old proxmoxer (#6839) 2023-07-03 22:07:05 +02:00
filter Update from_csv.py docs (#7296) 2023-09-20 22:02:54 +02:00
inventory Update proxmox.py (#7397) 2023-10-15 18:14:46 +02:00
lookup Drop support for ansible-core 2.11 and 2.12 (#7269) 2023-10-11 16:13:14 +02:00
module_utils Drop support for ansible-core 2.11 and 2.12 (#7269) 2023-10-11 16:13:14 +02:00
modules plugins/modules/cloudflare_dns: Add CAA record support (#7399) 2023-10-25 08:46:51 +02:00
test Fix more copyright lines, add more default copyright lines (#5095) 2022-08-08 14:24:58 +02:00