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/connection
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
..
chroot.py chroot: add disable_root_check option (#7099) 2023-08-14 19:41:33 +02:00
funcd.py Fix linting errors; fix some real bugs (#5111) 2022-08-12 11:07:30 +02:00
iocage.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) 2022-08-05 12:28:29 +02:00
jail.py Add 'inventory_hostname' to the jail plugin documentation (#6118) 2023-03-03 22:56:24 +01:00
lxc.py Handle remote_addr change in lxc connection plugin (#7373) 2023-10-18 20:54:24 +02:00
lxd.py plugins/connection/lxd: convert FQDN to instance name (#7360) 2023-10-25 08:47:27 +02:00
qubes.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) 2022-08-05 12:28:29 +02:00
saltstack.py Fix copyright lines (make sure 'Copyright' is there). (#5083) 2022-08-05 22:12:10 +02:00
zone.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) 2022-08-05 12:28:29 +02:00